vue-router 设置默认路由
设置 redirect值,就可以默认显示你想显示的那个路由页面import Vue from 'vue'import Router from 'vue-router'import Content from '@/components/Content'import Doctor from '@/components/comtent/Doctor'Vue.use(Router)expo...
·
设置 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
},
]
})
更多推荐
已为社区贡献9条内容
所有评论(0)