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

when plain element with v-bind="obj" has style property, style property mutation is not work #11691

Open
a42195472 opened this issue Aug 23, 2024 · 3 comments · May be fixed by #11693
Open

when plain element with v-bind="obj" has style property, style property mutation is not work #11691

a42195472 opened this issue Aug 23, 2024 · 3 comments · May be fixed by #11693
Labels
🐞 bug Something isn't working 🔩 p2-edge-case

Comments

@a42195472
Copy link

@jh-leong
Copy link
Member

As a workaround, you can reassign the style fields like this: Playground

// state.obj.style.color = 'yellow'
state.obj.style = {...state.obj.style, color: 'yellow'}

Or use a separate style binding: Playground

@a42195472
Copy link
Author

In the file of packages/runtime-core/src/vnode.ts, The guardReactiveProps function should use deep copy to handle reactive props?
If use a shallow copy of extend({}, props), the deep reactive obj of the props is a reference, so maybe cause this bug too @edison1105

@edison1105
Copy link
Member

@a42195472 Yes, that's true. The PR from @linzhe141 will fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🔩 p2-edge-case
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants