veaury icon indicating copy to clipboard operation
veaury copied to clipboard

可以在vue项目中写react代码的目录里所使用的类型提示忽略vue自身的提示吗

Open OPBR opened this issue 3 years ago • 1 comments

发现在vue项目里面的react目录里面写react组件时使用了三方库,这个三方库的类型提示会与vue自身的类型提示冲突。怎样可以避免这种情况或者在vue项目的react里面怎样可以忽略vue的TS提示呢

OPBR avatar Nov 16 '22 11:11 OPBR

@OPBR 这个问题在文档中有说明,难道高的做法是,使用 patch-package 修改@vue/runtime-dom/dist/runtime-dom.d.ts 和@types/react/index.d.ts,并确保在 tsconfig.json 将 compilerOptions.jsx 设置 preserve 。

或者就直接禁用ts,在tsconfig.json中通过配置exclude忽略react组件的目录

devilwjp avatar Nov 16 '22 11:11 devilwjp