question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vue.js 2.0 support

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:30 (27 by maintainers)

github_iconTop GitHub Comments

4reactions
icebobcommented, Feb 10, 2017

next branched merged to master. From now, master is for Vue 2.x, vue1 for Vue 1.x

2reactions
icebobcommented, Oct 4, 2016

I prefer to make a vue-next branch. The master stay for v1.x.x while the v2 implementation won’t be stable.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found