You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project where I utilize the ability to pass on a lot of attributes to my WebC components, but at the same time using props to control rendering and behavior of those components.
I ran into an issue when trying to use @attributes to automatically render passed attributes, where supposedly private props would be included in the final HTML output. I think that props that have dashes in them (and camelCased when using in the component) aren't marked as private correctly by WebC.
As you can see, myDashedProp is included in the output, because the property marking it as private within the attributes object is named my-dashed-prop___webc_privacy instead of myDashedProp___webc_privacy.
I'm guessing that these lines in attributeSerializer.js is where it goes wrong, but I don't feel I understand the internals of WebC enough to make a PR at this time.
I'm working on a project where I utilize the ability to pass on a lot of attributes to my WebC components, but at the same time using props to control rendering and behavior of those components.
I ran into an issue when trying to use
@attributes
to automatically render passed attributes, where supposedly private props would be included in the final HTML output. I think that props that have dashes in them (and camelCased when using in the component) aren't marked as private correctly by WebC.Here's a small test case:
page.webc
:test-component.webc
:Result:
As you can see,
myDashedProp
is included in the output, because the property marking it as private within the attributes object is namedmy-dashed-prop___webc_privacy
instead ofmyDashedProp___webc_privacy
.I'm guessing that these lines in
attributeSerializer.js
is where it goes wrong, but I don't feel I understand the internals of WebC enough to make a PR at this time.webc/src/attributeSerializer.js
Lines 121 to 140 in a2f548c
The text was updated successfully, but these errors were encountered: