设置 redirect值,就可以默认显示你想显示的那个路由页面

import Vue from 'vue'
import Router from 'vue-router'
import Content from '@/components/Content'
import Doctor from '@/components/comtent/Doctor'

Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      redirect: 'content'
    },
    {
      path: '/content',
      name: 'Content',
      component: Content
    },
    {
      path: '/doctor',
      name: 'Doctor',
      component: Doctor
    },
  ]
})

Logo

前往低代码交流专区

更多推荐