Before 0.12.8, computed properties behave just like getters - every time you access it, the getter function is re-evaluated. In 0.12.8 this has been improved - computed properties are cached and lazily re-evaluated only when necessary.
For my current project, I actually need some properties to be re-evaluated on every access. The reason the current lazy evaluation isn't working is because in some of my properties there are other "dynamic variables" that are not under Vue.js's watch.
According to the docs, you can simply set cache to false:
computed: {
example: {
cache: false,
get: function () {
return Date.now() + this.msg
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With