routing
This commit is contained in:
@ -9,28 +9,31 @@
|
||||
|
||||
import Vue from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
import Home from '../views/Home.vue';
|
||||
import About from '../views/About.vue';
|
||||
import AppView from '../views/AppView.vue';
|
||||
import NotFound from '../views/NotFound.vue';
|
||||
|
||||
Vue.use (VueRouter);
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: Home
|
||||
path: '/app/:id',
|
||||
name: 'AppView',
|
||||
component: AppView
|
||||
},
|
||||
{
|
||||
path: '/about',
|
||||
name: 'About',
|
||||
component: About
|
||||
}
|
||||
path: '/404',
|
||||
name: '404',
|
||||
component: NotFound
|
||||
},
|
||||
{ path: '*', redirect: '404' }
|
||||
];
|
||||
|
||||
const router = new VueRouter ({
|
||||
mode: 'history',
|
||||
base: process.env.BASE_URL,
|
||||
routes
|
||||
mode: 'history',
|
||||
// eslint-disable-next-line no-process-env
|
||||
base: process.env.BASE_URL,
|
||||
routes,
|
||||
fallback: true
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
Reference in New Issue
Block a user