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)
解决过程:
疯狂百度,只查明该报错与typescript相关,但是我这里是一个纯正的vue项目,也没有开启tslint,为啥会报这个错误呢?
于是重点关注结尾的Vetur(2339),想来应该是与Vetur插件相关。
禁用了Vetur相关的插件之后,果然不报错了。
但是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项目报错内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
您可能感兴趣的文章:- [ Vue-ts-错误 ] Property '$router|$store' does not exist on type Vue
- Property 'validate' does not exist on type 'Vue | Element | Vue[] | Element[]'
- studio编译出错Cannot get property 'versionCode' on extra properties extension as it does not exist
- TypeScript 错误“property does not exist on value of type”
- Ionic iframe - [ts] Property 'contentWindow' does not exist on type 'HTMLElement'.
- angular2 Property 'map' does not exist on type 'Observable<Response>'.
- Property 'subscribe' does not exist on type '() => Observable<any>'
- Laravel - Property [title] does not exist on this collection instance
- Property 'map' does not exist on type 'Observable'报错解决方案
- Property 'filter' does not exist on type 'Observable' 报错解决方法
- vue 报错 Property or method "name" is not defined on the instance but referenced解决方法
- Cannot get property 'compileSdkVersion' on extra properties extension as it does not exist解决方案
- 对与几种javax.el.PropertyNotFoundException: Property 'XXX' not found on type java.lang.String问题原因
- 使用vscode开发vue项目时候一直报错 '}' expected.Vetur(1005),遇到这种问题怎么解决,网上查了好多资料都没用
- File xxx specified for property 'resourceFile' does not exist.解决方法
- Cannot get property 'compileSdkVersion' on extra properties extension as it does not exist问题解决
- javax.el.PropertyNotFoundException: Property [seckillId] not found on type [xxx]
- javax.el.PropertyNotFoundException: Property 'xxx' not found on type com.xxx.xxx
- VSCode Markdown PDF 导出成 PDF 报 phantomjs binary does not exist 错误的解决办法
- Property 'XXX' not found on type java.lang.String解决方案