Vue.js 2.0 support
See original GitHub issueI guess it going to be hard to do, but this is something necessary. 2.0 changes
No more .sync
My first analysis point to one real problem, the disappearance of .sync
.
so instead of:
:model.sync="model", :schema.sync="field"
We should do:
:model="model", :schema="field", @model-updated="modelUpdated", @schema-updated="schemaUpdated"
and inside the fields (abstractField.js)
props: ["model", "schema"],
watch: {
model(newVal) {
this.$emit('model-updated', newValue)
},
schema(newVal) {
this.$emit('schema-updated', newValue)
}
}
Also change formGenerator.vue:
watch: {
// new model loaded
model: function(newModel, oldModel) {
if (oldModel == newModel) // model got a new property
return;
//console.log("Model changed!");
if (this.options.validateAfterLoad === true && this.isNewModel !== true)
this.validate();
else
this.clearValidationErrors();
}
}
to
methods: {
modelUpdated: function(newModel){
if (this.model == newModel) // model got a new property
return;
//console.log("Model changed!");
if (this.options.validateAfterLoad === true && this.isNewModel !== true)
this.validate();
else
this.clearValidationErrors();
}
}
This need to be tested.
Change in hook
Another thing could be related to ready
becoming mounted
. There’s no longer the guarantee to be in-document and could break most js dependent fields.
We should test if the component is in document ourself now. I have no idea how to do that.
Maybe check if vm.$el
have a parent ? And if not use a small setTimeout to lauch the test again soon ?
I’m sure I’m missing a lot of problem, but this seem achievable. What are your thought ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:30 (27 by maintainers)
Top Results From Across the Web
Vue.js - The Progressive JavaScript Framework | Vue.js
Builds on top of standard HTML, CSS and JavaScript with intuitive API and world-class documentation. Performant. Truly reactive, compiler-optimized rendering ...
Read more >Frequently Asked Questions - Vue.js
If you are starting a new project today, Vue 3 is the recommended choice. There are only a few reasons for you to...
Read more >Introduction - Vue.js
Vue CLI also supports building Vue components that register themselves as native custom elements. Ready for More? We've briefly introduced the most basic ......
Read more >Vue.js
Vue.js - The Progressive JavaScript Framework. ... Already know HTML, CSS and JavaScript? Read the guide and start building things in no time!...
Read more >Introduction - Vue.js
What is Vue? #. Vue (pronounced /vjuː/, like view) is a JavaScript framework for building user interfaces. It builds on top of standard...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
next
branched merged tomaster
. From now,master
is for Vue 2.x,vue1
for Vue 1.xI prefer to make a
vue-next
branch. Themaster
stay for v1.x.x while the v2 implementation won’t be stable.