文章加密

;

2021年7月22日 星期四

vue 動態屬性接return func 會一直觸發

因 為 

Instead of a computed property, we can define the same function as a method. For the end result, the two approaches are indeed exactly the same. However, the difference is that computed properties are cached based on their reactive dependencies. A computed property will only re-evaluate when some of its reactive dependencies have changed. This means as long as message has not changed, multiple access to the reversedMessage computed property will immediately return the previously computed result without having to run the function again.

(https://vuejs.org/v2/guide/computed.html)


在外層寫上v-once 可以讓裡面的element只render第一次

沒有留言:

張貼留言