Vue路由配置
阿新 • • 發佈:2021-01-03
技術標籤:Vue
import Vue from 'vue' import VueRouter from 'vue-router' import ff from '../views/ff.vue' import ff2 from '../views/ff2.vue' import fff from '../views/fff.vue' Vue.use(VueRouter) const routes = [ { path: '/', name: 'Index', redirect :{name :"FF"}//重定向到名字為FF的標籤這裡即重定向到/ff }
, { path: '/ff', name: 'FF', component: ff }, { path: '/ff2', name: 'FF2', component: ff2 }, { path: '/ff/fff', name: 'FFF', component: fff }, ] const router = new VueRouter({ mode: 'history', base: process.env.BASE_URL, routes }) export default router