mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 17:30:59 +01:00
fix dynamic component event code generation - fixes #1945
This commit is contained in:
parent
c1ee21b022
commit
0e59e8d4cb
@ -304,9 +304,7 @@ export default class InlineComponentWrapper extends Wrapper {
|
||||
});
|
||||
|
||||
const munged_handlers = this.node.handlers.map(handler => {
|
||||
// TODO return declarations from handler.render()?
|
||||
const snippet = handler.render(block);
|
||||
|
||||
return `${name}.$on("${handler.name}", ${snippet});`;
|
||||
});
|
||||
|
||||
@ -378,10 +376,6 @@ export default class InlineComponentWrapper extends Wrapper {
|
||||
${this.fragment && this.fragment.nodes.map(child => child.remount(name))}
|
||||
${name}.$$.fragment.c();
|
||||
@mount_component(${name}, ${updateMountNode}, ${anchor});
|
||||
|
||||
${this.node.handlers.map(handler => deindent`
|
||||
${name}.$on("${handler.name}", ${handler.var});
|
||||
`)}
|
||||
} else {
|
||||
${name} = null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user