Vue路由用法

一、Vue路由基础用法:
1 .安装
npm install vue-router --save
2 .main.js中
//Vue路由:引入
import VueRouter from 'vue-router'
Vue.use(VueRouter)

//Vue路由:引入并创建组件
import BYHome from './components/BYHome.vue'
import BYNews from './components/BYNews.vue'
import HelloWorld from './components/HelloWorld.vue'

//Vue路由:配置路由
const routes = [
{path: '/home', component: BYHome},
{path: '/news', component: BYNews},
{path: '/hellow

Vue路由用法最先出现在Python成神之路

版权声明:
作者:admin
链接:https://www.techfm.club/p/22108.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>