vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 402 forks source link

slot #4979

Closed wlonghaha closed 2 weeks ago

wlonghaha commented 2 weeks ago

Vue - Official extension or vue-tsc version

2.1.10

VSCode version

1.95.1

Vue version

3.5.12

TypeScript version

5.7.0-dev.*

System Info

No response

package.json dependencies

No response

Steps to reproduce

payload有test属性,但使用slot时没有提供该属性时应该显示ts错误

<script setup lang="ts">
defineSlots<{
  content?(payload: { test: string }): any;
}>();
</script>

<template>
  <slot name="content" haha=""></slot>
</template>

What is expected?

slot attr缺失时显示ts错误

What is actually happening?

payload有test属性,但使用slot时没有提供该属性时应该显示ts错误

Link to minimal reproduction

No response

Any additional comments?

thanks for your job❤

zcf0508 commented 2 weeks ago

playground 可以复现