0👍
In your data you can make a route object and simply pass it to your :to property
<template>
<div id="app">
<div id="nav">
<router-link :to="home_route">{{
$t("home")
}}</router-link>
|
<router-link to="/about">About</router-link>
</div>
<router-view />
</div>
</template>
<script>
import i18n from "./i18n";
export default {
data() {
return {
home_route : { name: 'HomeRoute', query: { lang: i18n.locale } }
};
},
</script>
- [Vuejs]-Vuetify.js v-data-table dynamic template
- [Vuejs]-Vue loses slot reactivity when use with render function
Source:stackexchange.com