I
I
Igor Bezlepkin2018-12-14 11:55:12
Vue.js
Igor Bezlepkin, 2018-12-14 11:55:12

Why does Vue cache reactive data?

Hey! I'm making an app with Vue + F7.
So there is a certain index.vue page. When you enter it, data is pulled from the database and placed in an object in data.
Then I follow the link to another page and return, the request to the database goes again, the object in data is updated,
but in the template {{ message }} it remains the same, as if it is cached.
How to deal with this so that the data is always updated?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fl3nkey, 2018-12-14
@FLUNKEY

I'm not exactly sure, because no sample code, but if you are using vue-router try this:
<router-view :key="$route.fullPath"></router-view>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question