0👍
With VueRouter
you can set a path like:
const routes = [
{ path: '/companya', name: 'companya', component: MyPage },
{ path: '/companyb', name: 'companyb', component: MyPage },
];
then in MyPage.vue
you can look at the current route:
created () {
switch (this.$route.name) {
case 'companyA':
// switch connection
break;
case 'companyB':
// switch connection
break;
}
},
- [Vuejs]-How to bind fontawesome icon name in Vue.js
- [Vuejs]-Use returned object from laravel controller in vue template
Source:stackexchange.com