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

  • Vue.js Quick Start Guide
  • Ajdin Imsirovic
  • 98字
  • 2021-06-24 18:23:57

Computed properties and methods

The usefulness of reactivity in Vue can be described in terms of the difference between computed properties and methods.

As we mentioned earlier, a Vue instance can have either computed properties, methods, or both computed properties and methods. So, what is the difference between the two?

Methods are simply run every time they are called. On the other hand, computed properties are cached, meaning they are only run when the underlying data model changes. This is often described in terms of computed property dependencies. Also, methods can have parameters, whereas computed properties cannot.

主站蜘蛛池模板: 攀枝花市| 武山县| 定结县| 丽水市| 苍南县| 富民县| 芜湖县| 延津县| 扎囊县| 长汀县| 华蓥市| 东山县| 资阳市| 四平市| 赣州市| 渭南市| 中卫市| 科技| 吴忠市| 博客| 中卫市| 遂川县| 平顶山市| 安远县| 南澳县| 年辖:市辖区| 环江| 福海县| 孟津县| 济阳县| 遵化市| 察雅县| 东宁县| 祁连县| 防城港市| 仁怀市| 勃利县| 文化| 盐源县| 都昌县| 双柏县|