element plus 使用v-loading报错解决Can‘t resolve ‘element-plus/es/components/loading-directive/style/index‘
报错如下:
Failed to compile.
./src/views/detectionSystems/deviceStatusList/index.vue?vue&type=template&id=2de634af&scoped=true (./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--34-0!./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--35-0!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/views/detectionSystems/deviceStatusList/index.vue?vue&type=template&id=2de634af&scoped=true) Module not found: Error: Can't resolve 'element-plus/es/components/loading-directive/style/index' in 'C:\code\SIDS\sids_jg_xuanwumen\src\views\detectionSystems\deviceStatusList'
解决办法:
1、手动引入
必须把css也引进来,然后使用组件方式。博主用了按需引入的,其他组件都可以,部分反馈组件不能用
import { ElLoading } from "element-plus";import "element-plus/es/components/loading/style/index";let loading = null; // loadingconst queryData = (type = "camera") => {requestDatas = [];loading = ElLoading.service({lock: true,text: "拼命加载中...",background: "rgba(0, 0, 0, 0.7)",});// 请求接口数据cameraChecProgress({ type }).then((res) => {loading.close();requestDatas = res.data; // 后端返回的数据state.paingAttr.total = requestDatas.length; // 总条数state.paingAttr.page = 1; // 第几页toPaging(); // 分页}).catch(() => {requestDatas = [];state.listDatas = [];state.paingAttr.total = 0;state.paingAttr.page = 1; // 第几页loading.close();});};
2、更新按需引入工具(推荐)
使用命令行更新按需引入包,安装完成后,需要重新启动项目
npm install unplugin-auto-import@latest unplugin-vue-components@latest --save-dev
楼主之前用了
更新后调整为
v-loading等反馈组件就可以按需引入了
element plus 使用v-loading报错解决Can‘t resolve ‘element-plus/es/components/loading-directive/style/index‘相关推荐
- Android 工程报错解决 Unable to resolve target 'android-17'
转自:http://www.cnblogs.com/csulennon/p/3705177.html 换了系统后,重新安装了Android SDK和ADT插件,导入之前的工作空间.居然发现所有的And ...
- gstreamer推流rtmp,报错解决(WARNING: erroneous pipeline: no element “rtmpsink“)
gstreamer推流rtmp,报错解决(WARNING: erroneous pipeline: no element "rtmpsink") 今天试着在本地推流视频流到服务器的 ...
- selenium+python,解决selenium弹出新页面,无法定位元素的问题(报错:Unable to locate element:元素)
selenium+python,解决selenium弹出新页面,无法定位元素的问题(报错:Unable to locate element:元素) 参考文章: (1)selenium+python,解 ...
- element is not attached to the page document报错解决办法
element is not attached to the page document报错解决办法 1.场景:将一条子单记录合并到母单记录,子单记录消失后,再次定位母单记录的操作按钮,报错 代码如下 ...
- salmon的报错解决error while loading shared libraries: libboost_iostreams.so.1.60.0
使用conda安装的软件salmon时报错为 error while loading shared libraries: libboost_iostreams.so.1.60.0 报错原因: cond ...
- 报错解决:加载数据库驱动报错-Loading class `com.mysql.jdbc.Driver‘. The new driver class is `com.mysql.cj.jdb
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.D ...
- 【matlab】【Datcom】气动解算软件win10报错解决办法及运行交互示例
版本说明 免费版本仍然可用.尚未使用Datcom + Pro版本的功能进行更新.没有大量的工作,我无法生成新的分发程序包,并且我现在对此不感兴趣.建议您观看教程视频,以了解使用新的Datcom + P ...
- virtualBox安装centos6增强包报错解决及配置共享文件夹
一.安装增强包 1.启动CentOS6.5 虚拟机,点击设备à 安装增强功能. 则 "光盘"VBOXADDITIONS已经挂载到 CentOS 5.5 的桌面上了. 此时 双 ...
- 从零开始在ubuntu上安装和使用k8s集群及报错解决
文章目录 安装docker 安装kubernetes 配置k8s集群 配置虚拟机网络 配置Master节点的k8s网络 拉取k8s需要的镜像 启动 kubeadm 和 kubelet 配置 node节 ...
最新文章
- 播客#47:劳伦斯·布拉德福德
- [C#基础知识系列]专题十二:迭代器
- 动态检测secure日志文件,iptables拒绝恶意IP
- Tensorflow:TF模型文件(checkpoint文件夹下ckpt文件之data、index、meta)保存、模型导入、恢复并fine-tuning之详细攻略
- JavaWeb学习过程 之c3p0的使用
- Weblogic 10.3.5在64位Windows系统下的安装和配置
- Linux系统下poll的使用方式
- DOM的​getElementById() 和 getElementsByTagName() 方法
- 基于C++11实现线程池的工作原理
- 【第24章】工控安全需求分析与安全保护工程(软考:信息安全工程师)-- 学习笔记
- 阅读SSM项目之scm
- 如何让研发薪酬更具有吸引力?华为、阿里、腾讯的方法值得借鉴
- Jetson Nano 2G 使用HDMI连接电视机没有声音的问题
- android可看电视吗,不要VIP也能看电影,安卓手机这4款APP太赞了!
- 使用Android SwipeRefreshLayout了解Android的嵌套滑动机制
- Python简单实现图像融合
- 视频突破500播放量的神操作秘密
- 动物声音模拟器, 模仿许多动物的叫声
- 解决研华数据采集板卡驱动包Xnavi在Win7系统下加载界面卡死问题
- 嵌入式 ARM 平台配置远程桌面