pull/6898/head
Yuichiro Yamashita 5 years ago
parent 11d12ab56a
commit 25a12a76ef

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

@ -221,7 +221,7 @@ export default class ElementWrapper extends Wrapper {
node.intro || node.outro ||
node.handlers.length > 0 ||
this.node.name === 'option' ||
node.is_dynamic_element ||
node.tag_expr.dynamic_dependencies().length ||
renderer.options.dev
) {
this.parent.cannot_use_innerhtml(); // need to use add_location

Loading…
Cancel
Save