在路由器部分,我们希望通过嵌套路由来路由页面,但是存在一个问题,它无法识别页面... 代码:
{
path: '/',
component: require('../view/layout/Layout').default,
children: [
{
path: '',
component: require('../view/Home').default,
name: 'home'
},
{
path: 'post/:slug',
component: require('../view/Post/PostShow').default,
name: 'post-show'
},
]
},
错误:
ERROR in ./resources/js/view/layout/Layout.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/view/layout/Layout.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '../components/Navigationdrawer' in '/home/../Desktop/../resources/js/view/layout'
@ ./resources/js/view/layout/Layout.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/view/layout/Layout.vue?vue&type=script&lang=js&) 11:0-62 16:22-38
@ ./resources/js/view/layout/Layout.vue?vue&type=script&lang=js&
@ ./resources/js/view/layout/Layout.vue
@ ./resources/js/router/router.js
@ ./resources/js/app.js
@ multi ./resources/js/app.js ./resources/sass/app.scss
答案 0 :(得分:0)
问题解决了。
import Navigationdrawer from "../../components/Navigationdrawer";