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 .xx-xx underlined naming conventions when used by WebComponent will result is not reactive #5687

Closed
hcg1023 opened this issue Apr 8, 2022 · 7 comments

Comments

@hcg1023
Copy link

hcg1023 commented Apr 8, 2022

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Enter the RFC, click the Random button, and components named with underlined lines will not be re-rendered, but camel names will work

What is expected?

The dash style also works

What is actually happening?

not works

@hcg1023
Copy link
Author

hcg1023 commented Apr 8, 2022

I wish I could fix this, but I found several places to fix this, such as patchProp,patchDOMProp, or VueElement's _resolveDef method, and I need a good suggestion

@LinusBorg LinusBorg self-assigned this Apr 8, 2022
@hcg1023
Copy link
Author

hcg1023 commented Apr 8, 2022

@LinusBorg Actually, WHAT I mean is that I want to develop and fix this problem by myself. I think it is most appropriate to modify it in the method resolveDef. I wonder if you can assign this task to me?

@LinusBorg
Copy link
Member

Hi @hcg1023

sure, you can work on this. I just assigned myself to remember to leave the suggestions you asked for.

I'm still thinking about this a bit in the context of not just custom elements but the assignment of element properties as a whole. Will get back to you shortly.

@hcg1023
Copy link
Author

hcg1023 commented Apr 8, 2022

@LinusBorg Ok, looking forward to your reply, I will do this based on your reply

@hcg1023
Copy link
Author

hcg1023 commented Apr 8, 2022

image
I saw this in the documentation and felt like it didn't work when it was precompiled

@hcg1023
Copy link
Author

hcg1023 commented Apr 8, 2022

image I saw this in the documentation and felt like it didn't work when it was precompiled

@yyx990803
Copy link
Member

This is expected behavior. When you use .xx shorthand or the .prop modifier, the key will be used as-is without any modification. You are expressing the intention to set the prop as a DOM property with the exact key.

If you are using it in DOM templates, .camel modifier will be needed.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants