Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using destructed prop inside function with satisfies throws not defined error #12061

Closed
minht11 opened this issue Sep 27, 2024 · 0 comments · Fixed by #12062
Closed

Using destructed prop inside function with satisfies throws not defined error #12061

minht11 opened this issue Sep 27, 2024 · 0 comments · Fixed by #12062

Comments

@minht11
Copy link

minht11 commented Sep 27, 2024

Vue version

3.5.10

Link to minimal reproduction

https://play.vuejs.org/#__PROD__eNp9kk1r3DAQhv/KoEs2YOyGtBfXu7QNKbSHNrSlJ0NQtGOvElkS+nAWFv/3jOTdzSaE3Ox5Z14987FjX60tx4isZk3AwSoecNVqgOa7MVCPXEVctuyiZVBRvKlOkujXCydtAI8hWorIwRoXYAcOuwIeeRCbAoQZbAy4hgk6ZwZoGb3Xss/H9PTSXikr+kk8WW+q2Z+cWcGCF0Z3si/vvdHEu0uYLUv2UqH7bYM02reshqwkjStlHn/mWHARi0NcbFA8vBG/99sUa9mNQ49uJIyjFrjrMczy9d9fuKXvoziYdVSU/Y74B71RMTHOad+iXhP2SV6m/ZFnInX/z19vA2p/aCqBpswp5+chXr3T+jPuZfkx17V6oinu55v2fbo8UFz3tOhALnm1NGufNpkvgFa3hDV2UuONM9Y3+3gNOg536GBaLc6fq7hIPFSSaTY8N1rD4hyWqwNhyjQKS2X6xdn//Ij09VkxG5PZTAyeB+k7iZ5YXjmNRtJRvTgT+nl5xXcxBEL5IpQUD9TfjFbunXKvieYqybmgmite3zpN7nZEl7ZBo7ssP5UXH9j0BFrOFFg=

Steps to reproduce

Have code like this:

<script setup lang="ts">

const { value } = defineProps<{ value: number }>()

const action = {
  handler: () => {
    console.log('Value is:', value)
  }
} satisfies { handler: () => void }
</script>

<template>
  <button @click="action.handler">
    Click
  </button>
</template>

Click button. See error.

What is expected?

Value prop should be accessible even when used with satisfies { handler: () => void }

What is actually happening?

Errro

System Info

n/a

Any additional comments?

No response

yyx990803 pushed a commit that referenced this issue Sep 28, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant