calculating the difference between the properties and methods vue methods

1, the results of both are exactly the same

2, calculated attribute is cached based on their dependence only when the relevant dependent changes they will be re-evaluated before other words, as long as he is dependent not changed, so every time you visit the calculated property value will return immediately calculations, not executing the function

3, methods method, each time the trigger is re-rendered, call the method will always execute the function again

4, having a calculated attribute cache function, and methods without

Guess you like

Origin www.cnblogs.com/ylw-sx/p/12461956.html