标签:import java view word outer rom name route apple
import router from ‘./router‘有的会报错
//等效于
//import router from ‘./router/index.js‘直接替换成这个
在index.js里面
import Vue from ‘vue‘
import Router from ‘vue-router‘ //导入组件路由组件
import HelloWorld from ‘@/components/HelloWorld‘
Vue.use(Router)//使用路由
export default new Router({
routes: [
{
path: ‘/user‘,//路由路径
name: ‘HelloWorld‘,
component: HelloWorld//组件路由
}
]
})
app.vue
<router-link to="/user"> to apple</router-link>
<router-view></router-view>
标签:import java view word outer rom name route apple
原文地址:https://www.cnblogs.com/xzhce/p/12814349.html