-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Description
Vue version
3.4.29
Link to minimal reproduction
https://github.com/magicandskill/vuejs-props-reassignment-reactivity/tree/main
Steps to reproduce
npm install,
npm run dev,
press the add count button,
What is expected?
Props destructuring like this:
const { text, count } = defineProps(['text','count'])
doesn't affect the reactivity of the props within the template because these variables aren't returned from setup().
But reassignment like this:
const props = defineProps(['text','count'])
const text = props.text
const count = props.count
will make the props not reactive in the template because they get returned and mask the props in the template.
These two versions are creating the same variables, so the results should be consistent.
What is actually happening?
Inconsistent behaviors in regard to returned variables from setup().
System Info
No response
Any additional comments?
No response
Metadata
Metadata
Assignees
Labels
No labels