actions: {
foo ({ state, commit, rootState }) {
commit('bar', rootState.%MODULENAME%.lang === 'ru' ? 'rub' : 'usd')
}
}
<div>
<component :is="componentName"/>
</div>
import news from '.....'
import posts from '.....'
import tags from '.....'
export default {
data() {
return {
componentName: 'news'
}
},
async beforeRouteEnter(to, from, next) {
const res = await getData();
this.componentName = res.data;
}
}