Router update to avoid if else check
parent
02f4924a4a
commit
093505e8d1
|
@ -1,6 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-93461466-1"></script>
|
||||
<script>
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<template>
|
||||
<Home v-if="$route.path === '/'" :theme="theme" @change-theme="changeTheme" />
|
||||
<App v-else :theme="theme" @change-theme="changeTheme" />
|
||||
<div>
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Home from './Home.vue';
|
||||
import App from './App.vue';
|
||||
import EventBus from '@/AppEventBus';
|
||||
|
||||
export default {
|
||||
|
@ -45,11 +44,11 @@ export default {
|
|||
cloneLinkElement.setAttribute('id', id);
|
||||
});
|
||||
},
|
||||
},
|
||||
}/*,
|
||||
components: {
|
||||
'App': App,
|
||||
'Home': Home
|
||||
}
|
||||
}*/
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {createRouter, createWebHashHistory} from 'vue-router'
|
||||
import Home from '../Home.vue';
|
||||
import App from '../App.vue';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
|
@ -8,6 +9,10 @@ const routes = [
|
|||
exact: true,
|
||||
component: Home
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: () => App,
|
||||
children: [
|
||||
{
|
||||
path: '/setup',
|
||||
name: 'setup',
|
||||
|
@ -827,6 +832,8 @@ const routes = [
|
|||
name: 'vuelidateform',
|
||||
component: () => import('../views/validation/VuelidateFormDemo.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
|
|
Loading…
Reference in New Issue