5

从 vuejs 中的同一文件夹加载 vue 组件时出现错误。我已正确导入。但是在构建时,它显示以下错误。

ERROR in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/table.vue.

Module not found: Error: Can't resolve 'features' in '/home/deploy/workspace/4url/static/shortening_url/src/components'
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/table.vue 67:0-32
 @ ./src/components/table.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue
 @ ./src/App.vue
 @ ./src/main.js
4

2 回答 2

1

尝试检查 App.vue 中的导入

您的导入路径不正确,这就是它显示错误的原因

import showQoute from './components/showQoute/showQuote.vue'

而不是

import showQoute from './components/showQuote.vue'

.

于 2020-04-11T18:04:23.270 回答
1

我们需要查看更多代码才能正确帮助您,但我的猜测是您做了类似..

import Features from "features";

代替..

import Features from "./features";

这意味着它将查看您的node_modules文件夹,而不是该文件所在的位置。

于 2019-03-21T09:09:54.557 回答