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成神之路。
共有 0 条评论