Updated to work with Nova 4 and Vue 3 #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main changes
Changed the way Vue knows when a field is updated. Previously it would watch it by accessing the parent component and then loop through its children to watch all of the relevent components. This no longer works in Vue 3 due to there no longer being one single "root" element. I replaced this with a custom Vue mixin:
CheckableValues
, which emits events whenever the field changes values using the Nova integrated Tinybus package.I was also required to change the way that the Vue code was compiled, as well as some other package changes and updates.
There are also some very minor changes to the Php.
Notes
In
field.js
, I had to use a loop to repeatedly check if it's is the correct time to add the mixin to the conditional fields. There is almost certainly a better way to do this but this current method works regardless.I have tested with most of the basic field types, but some of the more obscure and external fields might not work out of the box.
Resolves #78 @milewski
Resolves #76 @dees040