Created
April 28, 2016 18:20
-
-
Save tilleps/77c0721485a105e0e37230d8c867c66d to your computer and use it in GitHub Desktop.
VueJS data() being called twice on load
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Component = Vue.extend({ | |
template: "<div>Hello world</div>", | |
data: function () { | |
console.log('Component data()'); | |
return {}; | |
}, | |
ready: function () { | |
console.log('Component ready()'); | |
} | |
}); | |
var vm = new Component({ | |
el: "#app" | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment