zl程序教程

您现在的位置是:首页 >  前端

当前栏目

解决Vue问题:TypeScript intellisense is disabled on template. To enable, configure `“jsx“...

VueOntypescript 解决 to is ... Template
2023-09-11 14:15:12 时间

问题分析

TypeScript intellisense is disabled on template. To enable, configure `"jsx": "preserve"` in the `"compilerOptions"` property of tsconfig or jsconfig. To disable this prompt instead, configure `"experimentalDisableTemplateSupport": true` in `"vueCompilerOptions"` property.volar

出现原因

在vue项目中新建组件后,模板(template)上已禁用TypeScript智能感知。

解决方法

通过问题给的提示(见上图),在根目录下找到jsconfig.json文件,在tsconfig或jsconfig的“compilerOptions”属性中配置“jsx”:“preserve”。

添加“jsx”:“preserve”,

然后问题解决

不再出现问题提醒