javascript - webpack+vue routing, why router-link reports an error
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-06-14 10:54:02
0
3
838

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

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(3)
左手右手慢动作

As follows:

const app = new Vue({
    router, // 这里必须定义router后传入Vue中啊!
    el: '#inner',
    render: h => h(Shop)
})
typecho

Router is mounted into vue

学习ing

Add a colon before to

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template