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

相关推荐
用户9850335932823 分钟前
OpenLayers 热力图从原理到 Vue 组件一键接入
前端
颜酱25 分钟前
01 | 骨架搭建:FastAPI + Vue 跑通第一个 SSE 流式问答
前端·人工智能·后端
hoLzwEge31 分钟前
解码 IDE 智能提示:jsconfig.json 辅助开发全攻略
前端·前端框架
leoZ23133 分钟前
记忆系统与 Agent 定制完全指南(四):自定义 Agent 开发(一)
前端·chrome
慧一居士38 分钟前
Element Plus 按需引入的配置使用说明和完整示例
前端·vue.js
程序员黑豆39 分钟前
鸿蒙应用开发实战:从零学会自定义组件
前端·华为·harmonyos
leoZ2311 小时前
记忆系统与 Agent 定制完全指南(三):记忆的检索与使用
前端·chrome
遇乐的果园1 小时前
前端学习笔记-vue状态管理优化
前端·笔记·学习
GIS阵地2 小时前
QgsSingleBandPseudoColorRenderer 完整详解(QGIS 3.40.13 C++)
开发语言·前端·c++·qt·qgis
刘较瘦_3 小时前
AI 开发中的 Git Submodule 父子仓库模式:前后端分仓管理与协作实践
前端·github