This is how it is written in the nav.vue component
In main.js
Vue.use(VueRouter);
const routes = [
{ path: '/home', component: Shop },
{ path: '/long', component: LongTerm }
]
const router = new VueRouter({
routes: routes
})
const app = new Vue({
el: '#inner',
render: h => h(Shop)
})
The first page of Shop has been loaded,
Then the router-link reported an error, and the value inside was not displayed
ringa_lee2017-06-14 10:56:02
As follows:
const app = new Vue({
router, // 这里必须定义router后传入Vue中啊!
el: '#inner',
render: h => h(Shop)
})