Added custom element's unique component option ceStylesAttrs
#590
Closed
baiwusanyu-c
started this conversation in
RFC Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ce
support child component style tags and attribute settings core#7942Summary
When users use
custom element
to build elements, their styles are processed by the vue runtime and injected intoshadowRoot
. This causes some users to encounter difficulties when they want to set specific attributes on the style tag, just like in #6530Basic example
result:
result:
Detailed design
ceStylesAttrs
is acustom element
only feature.ceStylesAttrs
is an array. The order of its elements corresponds to the order of the style tags in SFC, and its content is set as an attribute on the style tag.ceStylesAttrs
array is a string, it will be used as the attribute nameceStylesAttrs
array are objects, each field is used as an attribute name, and the value corresponding to the field is used as the attribute value.Signature
Beta Was this translation helpful? Give feedback.
All reactions