vscode中的vue项目报错Property ‘xxx‘ does not exist on type ‘CombinedVueInstance<{ readyOnly...Vetur(2339)

问题描述:

今天早上一开机,打开项目,发现项目一片醒目的红色,查看报错原因提示:

Property ‘xxxx' does not exist on type 'CombinedVueInstance<{ readyOnly: unknown; businessPrice: unknown; travelStaffInfo: any; } & Record<never, any> & Vue, object, object, object, Record<never, any>>. Vetur(2339)

禁用了Vetur相关的插件之后,果然不报错了。
但是Vetur插件涉及到的东西太多了,格式化,代码片段,直接关闭会导致很多功能无法正常使用!
于是开始研究Vetur的配置,果然找到了玄机。

然后疯狂下滑,找到Validation: Interpolation一栏,看到这里有一句:

validate interpolation in <template> region using TypeScript language service

大意就是按照TypeScript 的语法规则去校验<template>中的语句。
豁然开朗,关闭该选项即可。

至于为啥会勾选上,八成是因为vetur升级的原因吧 。

到此这篇关于vscode中的vue项目报错Property ‘xxx‘ does not exist on type ‘CombinedVueInstance<{ readyOnly...Vetur(2339)的文章就介绍到这了,更多相关vscode vue项目报错内容请搜索来客网以前的文章或继续浏览下面的相关文章希望大家以后多多支持来客网!