Describe the bug

在应用vscode编辑器学习vue过程中,忽然发现vue组件定义的区域呈现红色的提示信息,影响代码编写。

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

心愿不显示这个信息

Screenshots

Environment / Version (please complete the following information):

  • OS : windows10
  • git : git version 2.30.0.windows.2
  • node: v18.15.0
  • npm: 9.5.0

Solution

通过鼠标移入到该 提示信息上方,借助 VScode 的语法提醒性能,找到了暗藏的办法

  1. 设置 ➞ 输出 vue.inlay
  2. 在筛选出的后果中,勾销勾选 Vue > Inlay Hints : Options Wrapper选项。

Additional context

之前还好好的,忽然变成这样,也未曾更新 VScode ,所以不是版本更新的问题。

Reference

Similar questions

Further reading

  • https://vuejs.org/guide/typescript/overview.html#definecomponent