-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Attribute text on a html tag overrides inner content #12211
Comments
same issue on 3.4.7 |
Thanks for reporting this. The issue occurs because Vue sets the As a workaround, you can use |
Thanks for the lightning-fast response and fix! 🤝 |
Thank you for the clarification. To explain my use case a bit more, I'm encountering the issue with overriding inner content when using v-bind in combination with our CMS component, which maps its own fields to an HTML element (e.g., for a banner). Here’s an example of what I'm working with:
In this scenario, I’m not sure how the Thank you in advance! |
@jh-leong thanks a lot for the quick fix |
If the const cmsBanner = {
id: 'ui_banner_1',
text: 'Some description',
target: '_blank',
href: '/some-href',
};
const obj = { ...cmsBanner };
delete obj.text; |
You can also do it this way to avoid the const { text, ...obj } = cmsBanner; |
Vue version
3.5.12
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-v477mx?file=src%2FApp.vue
Steps to reproduce
Add to html tag a attribute text
What is expected?
attribute text does not override content html tag a
What is actually happening?
attribute text overrides content html tag a
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: