我创建了一个RegisterPayMonthlyDialog.vue
在我的源树上调用的自定义组件。问题是当它在视图上导入时Monthly.vue
,npm 找不到模块。
错误
ERROR Failed to compile with 1 errors 11:06:29 PM
This dependency was not found:
* @/components/dialogs/RegisterPayMonthlyDialog in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./nod
e_modules/babel-loader/lib!./node_modules/vuetify-loader/lib/loader.js??ref--18-0!./node_modules/cache-load
er/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Monthly.vue?vue&type
=script&lang=js&
To install it, you can run: npm install --save @/components/dialogs/RegisterPayMonthlyDialog
源树
每月.vue
<template>
<v-container class="pa-5">
<h3>Mensalidades</h3>
</v-container>
</template>
<script>
import RegisterPayMonthlyDialog from "@/components/dialogs/RegisterPayMonthlyDialog"; // can't find it
export default {
name: "Monthly",
components: {
RegisterPayMonthlyDialog
},
data() {
return {
showPayMonthyDialog: false
};
}
};
</script>
注册PayMonthlyDialog.vue
<template>
<div class="text-center">
<v-dialog v-model="show" width="500">
<v-card>
<v-card-title primary-title class="title">Pagamento de mensalidade</v-card-title>
</v-card>
</v-dialog>
</div>
</template>s
<script>
export default {
name: "RegisterPayMonthlyDialog",
data() {
return {};
},
props: {
show: Boolean
}
};
</script>
你有一个错字错误。看下面的代码
您正在导入这个名为 的文件RegisterPayMonthlyDialog
,但您的文件被命名为RegisterPayMonhtlyDialog
,
要解决它,请将文件名更改为 RegisterPayMonthlyDialog.vue
并像这样导入
import RegisterPayMonthlyDialog from "@/components/dialogs/RegisterPayMonthlyDialog"
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句