Solve the problem of TS error when introducing the lodash library (or other third-party libraries): TS7016: Could not find a declaration file for module lodash

When using TS to develop a front-end project, if an error occurs when introducing a third-party file, for example, TS reports an error when introducing the lodash library:

TS7016: Could not find a declaration file for module lodash

You can add the following code to the "shims-vue.d.ts" file in the src directory

declare module '*.js'
declare module 'lodash'

Whoever reports an error will be added

Guess you like

Origin blog.csdn.net/xjtarzan/article/details/132433454