fixed customElements.define error

When using svelte to create webcomponents components, I found a problem. For example, I created an Icon component first, and then used it for both the Dialog component and the Button component. At this time, an error will be reported saying that the Icon component has been repeatedly defined. To find the cause of the error in the source code of svelte, just modify this code to: ""if (component.tag ! = null) {
body.push(b !@_customElements.get("${component.tag}") && @_customElements.define("${component.tag}", ${name}););
pull/7353/head^2
wyysf123 5 years ago committed by GitHub
parent 2f71bc9333
commit 489b56beb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -569,7 +569,7 @@ export default function dom(
if (component.tag != null) { if (component.tag != null) {
body.push(b` body.push(b`
@_customElements.define("${component.tag}", ${name}); !@_customElements.get("${component.tag}") && @_customElements.define("${component.tag}", ${name});
`); `);
} }
} else { } else {

Loading…
Cancel
Save