Enable global configuration for Fallthrough Attributes #611
sheikharifulislam
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Blogs Component
This is a simple
Blogscomponent. This component import and use theBlogcomponent. this component passes twov-modelwith modifiers and oneFallthrough Attribute(class)in the Blog component.Blog Component
What do I want to do?
Ans: I have received
name, age, nameModifiersprops on the blog component. but since I have passedmodel:age.number="age"on the blog component so VueJs automatically passageModifiersprops on the Blog component. But I do not receiveageModifiersprops on the Blog component because I don't need these props to me. since I don't receiveageModifiersprops on the Blog component so VueJs will automatically add to the props on the rootelement's attributes. but I don't want this. if I want to solve this problem. I can useinheritAttrs: falseon thedefineOptions macros. but the problem is if I useinheritAttrs: falseon thedefineOptions macrosVueJs will not automatically add theclass (Fallthrough Attributes)on the Blog component root element. Because of this, I have to use$attrs or useAttrs()on the ```Blog`` component and manually add these attributes on the root element.That solution I have thought
1. If
VueJsprovides such a way, if the user passes only validHTML attributes as Fallthrough Attributesthen VueJs will automatically add these Attributes to the root element otherwise, VueJs will automatically ignore adding these attributes to the root element.2. If
VueJsprovides such a way to registerFallthrough Attributeslist globally or locally, the user will list herFallthrough Attributesand VueJs automatically add these Attributes to the root element if theseFallthrough Attributes (as props)register on the list.Beta Was this translation helpful? Give feedback.
All reactions