官术网_书友最值得收藏!

Reactivity

A key feature of Vue's design is its reactivity system. When you modify data, the view automatically updates to reflect that change.

For example, if we create a function that pushes another item to our array of grocery items after the page has already been rendered, the page will automatically re-render to reflect that change:

setTimeout(function() {
  app.groceries.push('Apples');
}, 2000);

Two seconds after the initial rendering, we see this:

<p id="app">
  <h3>Grocery list</h3>
  <ul>
    <li>Bread</li>
    <li>Milk</li>
    <li>Apples</li>
  </ul>
</p>
主站蜘蛛池模板: 丹寨县| 宜良县| 福清市| 沈阳市| 吴川市| 孟村| 海盐县| 广安市| 淳化县| 永清县| 固始县| 文昌市| 黔南| 松潘县| 库车县| 台东市| 洛浦县| 台北市| 宿迁市| 磐安县| 黄浦区| 苏尼特左旗| 垫江县| 齐河县| SHOW| 晋州市| 定西市| 苍溪县| 常熟市| 南和县| 龙里县| 静乐县| 璧山县| 诸暨市| 华阴市| 土默特右旗| 科尔| 宁津县| 湘潭县| 平罗县| 蒙阴县|