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 setting some metadata as attributes on my elements and I don't want it to be rendered in the template. So the idea is to use a custom morphAttrs function to filter out undesired attributes on the check.
I believe it's easy to update, we just need to export morphAttrs and morphdomFactory on the index.js file.
-- Edit --
Or maybe we can only provide a callback function to filter the attributes of toNode. I just cloned the repo and changed this line in the morphAttrs function and it's working as I wanted.
exportdefaultfunctionmorphAttrs(fromNode,toNode){vartoNodeAttrs=Array.from(toNode.attributes).filter(attr=>!attr.name.includes('on:')&&attr.name!=='key'// filter out my metadata)varattr
...
The text was updated successfully, but these errors were encountered:
I'm setting some metadata as attributes on my elements and I don't want it to be rendered in the template. So the idea is to use a custom
morphAttrs
function to filter out undesired attributes on the check.I believe it's easy to update, we just need to export
morphAttrs
andmorphdomFactory
on the index.js file.-- Edit --
Or maybe we can only provide a callback function to filter the attributes of
toNode
. I just cloned the repo and changed this line in themorphAttrs
function and it's working as I wanted.The text was updated successfully, but these errors were encountered: