mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix: Vue.component(RouterLink) is undefined in vue-router 3.0.0 (#4668)
This commit is contained in:
parent
b210724e60
commit
7ff4058318
@ -81,6 +81,12 @@ const _routes = recursiveRoutes(router.routes, ' ', _components, 2)
|
||||
}).join('\n')%>
|
||||
|
||||
Vue.use(Router)
|
||||
// router-view was changed to RouterView in vue-router 3.0.2
|
||||
// Fix: Vue.component('RouterLink') is undefined in vue-router 3.0.0
|
||||
if (!Vue.component('RouterLink')) {
|
||||
Vue.options.components['RouterView'] = Vue.component('router-view')
|
||||
Vue.options.components['RouterLink'] = Vue.component('router-link')
|
||||
}
|
||||
|
||||
<% if (router.scrollBehavior) { %>
|
||||
const scrollBehavior = <%= serializeFunction(router.scrollBehavior) %>
|
||||
|
Loading…
Reference in New Issue
Block a user