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

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>
主站蜘蛛池模板: 彭阳县| 宣化县| 四子王旗| 铅山县| 同德县| 南郑县| 周宁县| 肥东县| 宝坻区| 塔河县| 始兴县| 沾益县| 诏安县| 长乐市| 沙雅县| 台江县| 苗栗县| 嵩明县| 林周县| 诸城市| 巴楚县| 侯马市| 南安市| 英山县| 长乐市| 绍兴市| 翁牛特旗| 威远县| 临安市| 咸宁市| 建昌县| 大足县| 杭锦旗| 县级市| 江安县| 龙陵县| 虹口区| 海原县| 安远县| 清原| 隆林|