【发布时间】:2020-01-30 01:09:10
【问题描述】:
我在我的源代码树上创建了一个名为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
源代码树
Monthly.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>
RegisterPayMonthlyDialog.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.vue中的template结束标记之后还有一个额外的s
标签: javascript vue.js npm