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

  • 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.

主站蜘蛛池模板: 大关县| 会同县| 承德市| 汝城县| 桂平市| 东安县| 太和县| 镶黄旗| 噶尔县| 铁岭县| 朝阳区| 聂拉木县| 社会| 茂名市| 闽清县| 德安县| 农安县| 尉氏县| 海原县| 扎赉特旗| 册亨县| 南投县| 霍邱县| 许昌市| 五大连池市| 海城市| 定南县| 湘阴县| 石河子市| 抚松县| 广东省| 广宗县| 玉龙| 德安县| 文安县| 浑源县| 金秀| 清原| 灵山县| 义马市| 三都|