1. 程式人生 > 其它 >Vue路由配置

Vue路由配置

技術標籤: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