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

相关推荐
p***h6431 天前
JavaScript在Node.js中的异步编程
开发语言·javascript·node.js
N***73851 天前
Vue网络编程详解
前端·javascript·vue.js
e***71671 天前
Spring Boot项目接收前端参数的11种方式
前端·spring boot·后端
程序猿小蒜1 天前
基于springboot的的学生干部管理系统开发与设计
java·前端·spring boot·后端·spring
银空飞羽1 天前
让Trae CN SOLO自主发挥,看看能做出一个什么样的项目
前端·人工智能·trae
Eshine、1 天前
解决前端项目中,浏览器无法正常加载带.gz名称的文件
前端·vue3·.gz·.gz名称的js文件无法被加载
q***38511 天前
TypeScript 与后端开发Node.js
javascript·typescript·node.js
用户47949283569151 天前
别再当 AI 的"人肉定位器"了:一个工具让 React 组件秒定位
前端·aigc·ai编程
Nan_Shu_6141 天前
学习:Sass
javascript·学习·es6
WYiQIU1 天前
面了一次字节前端岗,我才知道何为“造火箭”的极致!
前端·javascript·vue.js·react.js·面试