Home > Web Front-end > JS Tutorial > body text

Some things to note when developing with vue.js_Others

WBOY
Release: 2016-05-16 15:03:28
Original
2195 people have browsed it

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'
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template