Disable the caching function that comes with Vue computing properties.
All Vue users will know the computing attributes of vue. This is explained in the following way. When some dependent values change, their own values also change, and the First DOM also changes. Normally, there are two methods in this calculation attribute: get and set.
Here I will only analyze how to disable the computing attribute cache to obtain the latest data, as shown in the following example:
HTML code
<Div id = "mess"> <div >{{ exapm }}</div> </div>
JS Code:
Var vue2 = new Vue ({el: "# mess", data: {sendmess: "I dhsjknkjvnkrenvr"}, computed: {exapm: {cache: false, get: function () {return Date. now () + this. sendmess }}}});
We need to set the cache to false so that the cache is cleared. Each time we set the cache time to the current time.
The cache function that comes with the Vue computing attribute is all the content that I have shared with you in this article. I hope you can give us a reference and support for more customers.