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

props definition: mutating referenced object by adding array indexes #6915

Closed
gregg-cbs opened this issue Oct 20, 2022 · 0 comments · Fixed by #6916
Closed

props definition: mutating referenced object by adding array indexes #6915

gregg-cbs opened this issue Oct 20, 2022 · 0 comments · Fixed by #6916
Labels
🐞 bug Something isn't working

Comments

@gregg-cbs
Copy link

gregg-cbs commented Oct 20, 2022

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

@LinusBorg LinusBorg added the 🐞 bug Something isn't working label Oct 20, 2022
@LinusBorg LinusBorg self-assigned this Oct 20, 2022
LinusBorg added a commit that referenced this issue Oct 20, 2022
@LinusBorg LinusBorg added 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. and removed 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Oct 20, 2022
@LinusBorg LinusBorg removed their assignment Oct 20, 2022
LinusBorg added a commit that referenced this issue Oct 22, 2022
chrislone pushed a commit to chrislone/core that referenced this issue Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
2 participants