白衣染霜花
使用vue-router配置路由 在vue根实例中注入import Vue from 'vue'import VueRouter from 'vue-router'import topNav from '../components/topNav'import mine from '../components/mine'import searchPage from '../components/searchPage'import searchResult from '../components/searchResult'import playPage from '../components/playPage'import playbottom from '../components/playbottom'import latestPlay from '../components/latestPlay'Vue.use(VueRouter)const router = new VueRouter({ routes: [ { path: '/', component: mine }, { path: '/mine', component: mine }, { path: '/mine/searchPage', component: searchPage }, { path: '/mine/searchPage/searchResult', component: searchResult }, { path: '/playPage', component: playPage }, { path: '/latestPlay', component: latestPlay } ]})export default routerimport router from '../router'var app = new Vue({ el: "#app1", router, store: vuex_store,})大概就是这样 链接用<router-link to="/play"></router-link>这样 建议还是通过文档学习