element-plus [TypeScript] Many props does not support ref type

yhqotfr8  于 2个月前  发布在  TypeScript
关注(0)|答案(8)|浏览(46)

Bug Type: TypeScript

Environment

  • Vue Version: 3.2.47
  • Element Plus Version: 2.3.1
  • Browser / OS: Chrome
  • Build Tool: Vite

Reproduction

  • el-backtop
  • el-skeleton
  • el-option

Element Plus Playground

Steps to reproduce

I am using WebStorm.
Some components' props type cannot be recognized if passing ref type.

What is Expected?

should support

What is actually happening?

ElOption

Type string is not assignable to type InferPropType<{required: true, type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[]}>   Type string is not assignable to type never

ElSkeleton

Type unknown is not assignable to type import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>   Type unknown is not assignable to type boolean

ElBacktop

Type unknown is not assignable to type number

Additional comments

maybe related: #6244
Document example is using ref: https://element-plus.org/zh-CN/component/skeleton.html#%E5%8A%A0%E8%BD%BD%E7%8A%B6%E6%80%81

7uhlpewt

7uhlpewt1#

Is there a volar plugin installed?

jpfvwuh4

jpfvwuh42#

volar

No

In addition, I am using Nuxt3.

bpzcxfmw

bpzcxfmw3#

Try installing the volar plugin?

hi3rlvi2

hi3rlvi25#

volar

I already installed this module, is there a package named volar?

b4wnujal

b4wnujal7#

volar is ide plugin

Seems that plugin does not support WebStorm

vuejs/language-tools#571 (comment)

exdqitrt

exdqitrt8#

This looks like your IDE cannot infer the correct type

相关问题