Closed owen8877 closed 5 years ago
你可以尝试一下把router/index.js里的所有@换为..;
你可以尝试一下把router/index.js里的所有@换为..; @owen8877 @tuxinghuan 很奇怪,晚会儿我看看怎么回事。
我也遇到相同bug,把@修改为..也是不行的,错误如下: @tuxinghuan @shuiRong
@owen8877 @Saferman @tuxinghuan 我重新Clone项目后没有重现,但我可能猜到问题所在了。
代码改动看这里。我猜测是Webpack的问题,Webpack应该在路径不全的情况下,尝试按照某模式去尝试匹配路径的,比如:simple.js、simple.vue、simple/index.js、simple/index.vue (我猜测是因为我文件名用了大写的Index.vue
,而不是小写的index.vue
)。
你们可以重新pull下代码,如果没有问题,记得回来Close this issue
首先感谢 @shuiRong 的解答,但是你的解决方案仍然有些错误 虽然我是零基础vue,js,我刚刚自学了vue然后阅读你的源码发现了问题,和你给的解答基本是一样的。我发现你的acfun目录下是index.vue,而zhihu、jianshu、v2ex是Index.vue。你的更改将 component: () => import('@/components/acfun/simple')改为了component: () => import('@/components/acfun/simple/Index'),但是npm run dev的时候仍然无法定位到acfun/simple下的 index.vue 强烈建议在下次的版本中统一componets中的各个模板格式
@Saferman 感谢提醒。acfun部分的代码是其他小伙伴写的2333,没统一上,明天我改正。
谢谢两位,已经可以正常运行了。
刚看到这个项目很感兴趣,但是 vue 接触不多,请见谅。
我 clone 了这个 repo 之后直接
npm i
,安装了 vue-cli 之后运行了 dev 任务(或者npm run dev
也会有同样的报错):不知道是不是 node 开关的问题?还是需要配置
babel-plugin-root-import
等包。