0👍
Add a key to the component like this
<my-component :key="identifier" />
And in the data add a variable identifier
data() {
return {
identifier: +new Date()
};
},
methods: {
refreshComponent() {
this.identifer = +new Date();
}
},
What we are doing here is we have added a key to the component, so when we change the key, the component will refresh.
- [Vuejs]-Vue router react on parent component using a modal
- [Vuejs]-Unable to add a chart to my vue component
Source:stackexchange.com