javascript - vue2.0开发时导入组件时出错

查看:106
本文介绍了javascript - vue2.0开发时导入组件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

导入自定义组件时出现了如下错误

 ERROR  Failed to compile with 1 errors                                 12:35:41


This dependency was not found:

* components/star/star in ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?ty
pe=script&index=0!./src/components/header/header.vue

To install it, you can run: npm install --save components/star/star

跪求解决办法

解决方案

首先是检查下你的路径有没有错;其次是你import的时候加上.vue后缀试试(components/star/star.vue

这篇关于javascript - vue2.0开发时导入组件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆