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

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>
主站蜘蛛池模板: 济源市| 康平县| 博客| 龙州县| 库车县| 赤壁市| 乐至县| 建昌县| 溧阳市| 沙洋县| 子长县| 昂仁县| 隆昌县| 阳东县| 蒙阴县| 建始县| 广水市| 宁阳县| 商水县| 宣恩县| 偃师市| 竹山县| 永定县| 大兴区| 延长县| 湘阴县| 乌兰浩特市| 全州县| 东山县| 积石山| 临武县| 东辽县| 龙州县| 容城县| 沂南县| 贡觉县| 建宁县| 独山县| 石柱| 延吉市| 大方县|