-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
props definition: mutating referenced object by adding array indexes #6915
Labels
🐞 bug
Something isn't working
Comments
LinusBorg
added a commit
that referenced
this issue
Oct 20, 2022
…ring props normalization (close: #6915
chrislone
pushed a commit
to chrislone/core
that referenced
this issue
Feb 4, 2023
…ring props normalization (close: vuejs#6915) (vuejs#6916)
zhangzhonghe
pushed a commit
to zhangzhonghe/core
that referenced
this issue
Apr 12, 2023
…ring props normalization (close: vuejs#6915) (vuejs#6916)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Vue version
3.2.41
Link to minimal reproduction
https://codesandbox.io/s/brave-blackburn-rpbrmo?file=/src/components/Image.vue:91-135
Steps to reproduce
Look at the console of the codesandbox to see the logs and what props has done to the props object.
Create a component, in the script tag create variable and assign an object to it, in that object specify your props. In your component options api for props, reference the variable, console log the variable and notice that vue has modified the object and added array indexes to it. Now this object is useless because it cannot be used in other components for defining props.
What is expected?
Vue not to mutate objects because this stops it being used elsewhere.
What is actually happening?
Vue is mutating an object which it shouldnt be doing
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: