TypeError: Components is not a function

Vue中按需引入Element-plus时,报错TypeError: Components is not a function。

1、参考Element-plus官方文档

安装unplugin-vue-components 和 unplugin-auto-import这两款插件

2、然后需要在vue.config.js中配置webPack打包plugin配置

3、重新启动项目会报错

TypeError: Components is not a function

解决方案:

将 unplugin-auto-import 和 unplugin-vue-components这两款插件分别降低至0.16.1和0.25.2。

通过执行如下命令可解决:

npm install -D unplugin-auto-import@0.16.1

npm install -D unplugin-vue-components@0.25.2

相关推荐
彭亚川Allen8 分钟前
从零手搓 RAG 之检索全流程,给大模型接上自己的知识库
前端·后端·ai编程
IT_陈寒10 分钟前
别让Java字符串拼接偷偷吃掉你的内存
前端·人工智能·后端
软件技术NINI42 分钟前
圣罗兰彩妆html+css 4页
前端·css·html
2601_951615201 小时前
网站模板 网站网页模板下载
前端·网络·html
酷炫码神2 小时前
Day 1|HTML5:一个商城首页的骨架,从 DOCTYPE 到语义化
前端·html·html5
AI源码2 小时前
鲜花商城(HTML 版)
前端·html
hiahiahia1232 小时前
Message 和对话
服务器·前端·数据库
雪芽蓝域zzs3 小时前
第 7 节:多边形点击弹窗 + 清空绘制按钮
vue.js
溪语流沙3 小时前
【Web全栈进阶】Composition API与组件通信:props深入、emit、插槽
前端·css·vue.js
ZoeLandia3 小时前
TypeScript 03:泛型与工具类型
前端·typescript