stop to transform to normal element even if svelte:element's value of this is literal

pull/6898/head
baseballyama 5 years ago
parent d146c297ac
commit 7a832d69fd

@ -143,14 +143,14 @@ export default class Element extends Node {
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode) { constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode) {
super(component, parent, scope, info); super(component, parent, scope, info);
if (info.name === 'svelte:element' && typeof info.tag === 'string') {
this.name = info.tag;
} else {
this.name = info.name; this.name = info.name;
}
if (info.name === 'svelte:element' && typeof info.tag !== 'string') { if (info.name === 'svelte:element') {
if (typeof info.tag !== 'string') {
this.tag_expr = new Expression(component, this, scope, info.tag); this.tag_expr = new Expression(component, this, scope, info.tag);
} else {
this.tag_expr = new Expression(component, this, scope, string_literal(info.tag) as Literal);
}
} else { } else {
this.tag_expr = new Expression(component, this, scope, string_literal(this.name) as Literal); this.tag_expr = new Expression(component, this, scope, string_literal(this.name) as Literal);
} }

Loading…
Cancel
Save