S
S
seredaes2019-09-04 09:51:49
JavaScript
seredaes, 2019-09-04 09:51:49

How to reload a VueJS component?

Hi connoisseurs :)
This is how I have caching enabled for two components through the route.
All OK. But sometimes I need to delete the cache and reload the component.

<keep-alive include="page1, page2">
     <router-view></router-view>
</keep-alive>

I tried like this
this.$forceUpdate();
There is no error, but there is no result either ... I did everything in the activated
method , checked the value in the VUEX state, and I need to reload. I read somewhere about window.location.reload () and stupidly, but it works :) but why then Vue if everything is hard reloaded. I've only learned (in quotes) VueJS for a week and I don't understand all the points. Tell me how to correctly enable and disable caching inside the component. Thanks in advance for the replies!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2019-09-04
@Fragster

https://jsfiddle.net/vd3jygLo/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question