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

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>
主站蜘蛛池模板: 汉沽区| 横峰县| 卓资县| 墨竹工卡县| 项城市| 宝坻区| 成安县| 密云县| 林甸县| 全州县| 剑河县| 岳普湖县| 布尔津县| 宝山区| 年辖:市辖区| 龙江县| 应城市| 八宿县| 九龙坡区| 崇仁县| 肥东县| 石城县| 宿州市| 舒兰市| 锦州市| 河间市| 陵水| 太和县| 石嘴山市| 长顺县| 内黄县| 黑山县| 凭祥市| 花垣县| 遂平县| 永济市| 乡城县| 固阳县| 两当县| 焦作市| 循化|