问题

.ts 文件中引入三方模块报错.
Could not find a declaration file for module 'lodash'. 'xxx/node_modules/lodash/lodash.js' implicitly has an 'any' type. Try 'npm i --save-dev @types/lodash' if it exists or add a new declaration (.d.ts) file containing declare module 'lodash';
在这里插入图片描述

解决方案

方案1:

shims-vue.d.ts 文件中加入代码 declare module 'lodashe'

方案2:

npm i --save-dev @types/lodash

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐