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 405 forks source link

Slot doesn't reference variables correctly when registering events with @xxx syntax #4862

Closed makedopamine closed 1 month ago

makedopamine commented 2 months ago

Vue - Official extension or vue-tsc version

2.1.6

VSCode version

1.93.1

Vue version

3.5.7

TypeScript version

5.6.2

System Info

No response

package.json dependencies

"dependencies": {
  "typescript": "^5.6.2",
  "vue": "^3.5.7"
}

Steps to reproduce

<script setup lang="ts">
const foo = 'foo'
const bar = () => {}
</script>

<template>
    <slot :foo="foo" @bar="bar"></slot>
</template>

What is expected?

Variable references in the generated code should be aligned with those in the template code.

What is actually happening?

image

Link to minimal reproduction

No response

Any additional comments?

No response