vue3+vite搭建后台项目-1 引入element-plus 中文包,打包时报错问题

vue3+vite搭建后台项目-1 引入element-plus 中文包,打包时报错问题

终端报错

bash 复制代码
If the'element-plus'package actually exposes this module, try adding a new declaration (.d.ts) file containing are module'element-plus/dist/locale/zh-cn.mjs'dec
import zhCn from'element-plus/dist/locale/zh-cn.mjs'

解决方案 加入下方注释 //@ts-ignore 切记加//

typescript 复制代码
// @ts-ignore忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
相关推荐
爱泡脚的鸡腿19 小时前
ts学习D1---超基础语法导入
typescript
vivo互联网技术20 小时前
浅谈 AI 搜索前端打字机效果的实现方案演进
前端·vue·dom
q***38511 天前
TypeScript 与后端开发Node.js
javascript·typescript·node.js
lichong9512 天前
鸿蒙 web组件开发
前端·typescript
Tonychen2 天前
TypeScript 里 infer 常见用法
前端·typescript
烛阴2 天前
Luban集成CocosCreator完整教程
前端·typescript·cocos creator
2013编程爱好者2 天前
Vue工程结构分析
前端·javascript·vue.js·typescript·前端框架
QQRRRRW2 天前
Tailwind+VScode (Vite + React + TypeScript) 原理与实践
vscode·react.js·typescript
我叫张小白。3 天前
JavaScript现代语法梳理:ES6+核心特性详解
开发语言·javascript·typescript·es6
我叫张小白。3 天前
TypeScript泛型进阶:掌握类型系统的强大工具
前端·javascript·typescript