当前位置: 首页 > news >正文

vue3 使用 elementUi: ./lib/theme-chalk/index.css is not exported from package

目录

  • 1. 在 vue3 中使用 element-ui
  • 2. 如果启动报错:Module not found: Error: Package path ./lib/theme-chalk/index.css is not exported from package

1. 在 vue3 中使用 element-ui

在 vue3 中使用 element-ui,我们的流程一般是这样的:

  1. 安装Element-Plus

    npm i element-plus -S
    
  2. main.js 中全局引入 element-plus

    import { createApp } from 'vue'
    import ElementPlus from 'element-plus';
    import 'element-plus/dist/index.css';
    import App from './App.vue'createApp(App).use(ElementPlus).mount('#app')
    
  3. 在 HelloWorld.vue 中测试一下

    <template><div class="hello"><el-button type="primary">搜索</el-button></div>
    </template>
    
  4. npm run serve 跑一下服务

2. 如果启动报错:Module not found: Error: Package path ./lib/theme-chalk/index.css is not exported from package

那就说明,main.js 中 element-plus 的 index.css 路径给配错了,这时候只需要打开 /node_modules/element-plus 去找到 index.css ,然后更改 main.js 中的路径就 OK 了。

http://www.lryc.cn/news/207026.html

相关文章:

  • [ROS系列]ORB_SLAM3错误版本(仅记录)
  • APP盾的防御机制及应用场景
  • Unity性能优化一本通
  • Mysql,SqlServer,Oracle获取库名 表名 列名
  • errno变量和显示错误信息
  • Centos 7 安装 Docker Enginee
  • 通过js来实现用身份证号来判断性别和出生年月
  • 华为数通方向HCIP-DataCom H12-831题库(多选题:61-80)
  • 【T】03
  • VBA技术资料MF73:将Logo添加到页眉侧
  • 听GPT 讲Rust源代码--library/std(1)
  • Vue源码总结
  • 记一次调试微信订阅消息的坑
  • ASP.NET Core3.1 API 创建(Swagger配置、数据库连接Sql Server)、开发、部署
  • 大数据之LibrA数据库常见术语(八)
  • 【实战】Kubernetes安装持久化工具NFS-StorageClass
  • 透明安全地解释Moonbeam基金会分配的GLMR去了哪
  • python安装包失败 安装scipy包
  • 解决javascript报错:SyntaxError: Invalid Unicode escape sequence
  • 【Python第三方包】使用Python的Translate包进行文本翻译
  • 【OpenCV实现图像阈值处理】
  • 【Python机器学习】零基础掌握StackingRegressor集成学习
  • JVM(Java Virtual Machine)G1收集器篇
  • 微信小程序设计之主体文件app-json-tabBar
  • GZ035 5G组网与运维赛题第2套
  • 如何训练Embedding Model
  • springboot配置redis、Spring cache
  • 悟空crm安装搭建 报错[0] RedisException in Redis.php line 56问题处理办法
  • Ubuntu22.04 交叉编译阿里oss c-sdk
  • arch linux 安装 vsftpd 配置虚拟用户