路由跳转步骤
1、创建要跳转的vue组件
2、将组件注入路由对象
(1)在router包下的index.js文件中注入新创建的组件
import Home from '@/components/Home'
(2)在路由规则中添加组件路由
{ path: '/home', component: Home }
3、跳转函数代码
微信扫一扫
路由跳转步骤
1、创建要跳转的vue组件
2、将组件注入路由对象
(1)在router包下的index.js文件中注入新创建的组件
import Home from '@/components/Home'
(2)在路由规则中添加组件路由
{ path: '/home', component: Home }
3、跳转函数代码
相关推荐