admin管理员组

文章数量:1640988

发现问题

vscode 安装 Vue Language Features (volar) 后出现 :

TypeScript intellisense is disabled on template, you can config “jsx”: “preserve” in tsconfig or jsconfig to enable it, or config vueCompilerOptions.experimentalDisableTemplateSupport to disable this prompt.

解决问题

问题的描述是:TypeScript智能感知在模板中是禁用的,你可以在tsconfig或jsconfig中配置’ “jsx”: "preserve"来启用它,或者配置’ vueCompilerOptions '。 使用experimentalDisableTemplateSupport来禁用这个提示。那么我们根据描述解决问题

// 在文件 jsconfig.json 中
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@/*": [
        "src/*"
      ]
    },
    "jsx": "preserve" //添加配置
  },
  "exclude": [
    "node_modules",
    "dist"
  ]
}

问题得以解决。

如果还会存在问题,可以使用vetur插件格式化文档。将Vue Language Features (volar) 禁用后重启VScode即可。


点赞 评论 收藏 ~~ 留言讨论,如有错误,也希望大家不吝指出。 ~~ 点赞 评论 收藏

本文标签: 报错typescriptVSCodetemplatedisabled