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
Describe the bug
I use nuxt-custom-elements to generate a ce within a shadow dom (shadow: true).
To instantiate the shadow root, I have to add the hook beforeCreateVueInstance which is only recognized if tag options are given as a function. Otherwise, the JSON.stringify ignores the function.
However, if options are given as function, the HTML entry in the test index.html is not generated with default props, since the function getTagHTMLFromEntry does not evaluate the functin.
Afaik, the solution would be to change the getTagHTMLFromEntry function's first line to const options = typeof tag.options === 'function' ? tag.options() : (tag.options || {});
In my tests, everything works fine.
The text was updated successfully, but these errors were encountered:
There will now be a change in relation to Shadow DOM in version 1.8.0.
An entry option shadow sets all contained tags to a shadow element with styling.
I set the hook beforeCreateVueInstance and modify the webpack configuration of the entries and modify the two loaders (vue-loader and vue-style-loader) for the shadowMode.
Describe the bug
I use nuxt-custom-elements to generate a ce within a shadow dom (shadow: true).
To instantiate the shadow root, I have to add the hook beforeCreateVueInstance which is only recognized if tag options are given as a function. Otherwise, the JSON.stringify ignores the function.
However, if options are given as function, the HTML entry in the test index.html is not generated with default props, since the function
getTagHTMLFromEntry
does not evaluate the functin.Afaik, the solution would be to change the
getTagHTMLFromEntry
function's first line toconst options = typeof tag.options === 'function' ? tag.options() : (tag.options || {});
In my tests, everything works fine.
The text was updated successfully, but these errors were encountered: