边学边用VUE,踩坑不少,记性也越来越差了,记录下。

很简单一个VUE文件,VSCode给出了问题提示,如下图,错误信息:

[{
  "resource": "/f:/helloworld/src/pages/dashboard.vue",
  "owner": "_generated_diagnostic_collection_name_#0",
  "code": "2345",
  "severity": 8,
  "message": "Argument of type '{ data(): {}; }' is not assignable to parameter of type 'new (...args: any[]) => unknown'.\n Type '{ data(): {}; }' provides no match for the signature 'new (...args: any[]): unknown'.",
  "source": "Vetur",
  "startLineNumber": 1,
  "startColumn": 1,
  "endLineNumber": 1,
  "endColumn": 1
}]

VUE Argument of type '{ data(): {}; }' is not assignable to parameter of type 'new (...args: any[]) => unknown' 报错

 

虽然运行没啥问题,但是太刺眼,一番搜索,找到解决方法:

项目中搜索 settings.json 文件,在.vscode目录下

VUE Argument of type '{ data(): {}; }' is not assignable to parameter of type 'new (...args: any[]) => unknown' 报错

添加以下内容:

VUE Argument of type '{ data(): {}; }' is not assignable to parameter of type 'new (...args: any[]) => unknown' 报错

就可以了。

感谢@老衲的少女心i~,链接:报错#vue项目#Vetur(2345):Argument of type ‘{}‘ is not assignable to parameter of type ‘new (...args: any_老衲的少女心i~-CSDN博客

相关文章:

  • 2021-10-11
  • 2021-10-21
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-04-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
相关资源
相似解决方案