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
-
Blogs Component
This is a simple
Blogs
component. This component import and use theBlog
component. this component passes twov-model
with modifiers and oneFallthrough Attribute(class)
in the Blog component.Blog Component
What do I want to do?
Ans: I have received
name, age, nameModifiers
props on the blog component. but since I have passedmodel:age.number="age"
on the blog component so VueJs automatically passageModifiers
props on the Blog component. But I do not receiveageModifiers
props on the Blog component because I don't need these props to me. since I don't receiveageModifiers
props 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: false
on thedefineOptions macros
. but the problem is if I useinheritAttrs: false
on thedefineOptions macros
VueJs 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
VueJs
provides such a way, if the user passes only validHTML attributes as Fallthrough Attributes
then VueJs will automatically add these Attributes to the root element otherwise, VueJs will automatically ignore adding these attributes to the root element.2. If
VueJs
provides such a way to registerFallthrough Attributes
list globally or locally, the user will list herFallthrough Attributes
and 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