Home > Article > Web Front-end > Some things to note when developing with vue.js_Others
About responsiveness
Vue’s two-way binding is based on responsiveness, that is, adding getter and setter methods to the properties of a Vue object, and processing two-way binding in these methods. But this method will cause the following pitfalls
Object responsive
If the properties in Vue are Objects, or arrays, and there are Objects in the array, then it is best to define all the properties that need to be used for these Objects at the beginning. If you add properties again during operation, this property If it is not responsive, it will not implement two-way binding, for example:
const vm = new Vue({ data: { a: { text: 'aaa' } } }) vm.a.b = 'ccc'
In this case, the b attribute of a is not responsive, so it will not be bound in both directions
Date object
Operations on Date objects are not responsive