add component event declarations

pull/1864/head
Rich Harris 7 years ago
parent 6786e1b0de
commit f93a647913

@ -256,6 +256,12 @@ export default class InlineComponentWrapper extends Wrapper {
} }
const munged_handlers = this.node.handlers.map(handler => { const munged_handlers = this.node.handlers.map(handler => {
if (handler.expression) {
handler.expression.declarations.forEach(declaration => {
block.builders.init.addBlock(declaration);
});
}
return `${name}.$on("${handler.name}", ${handler.snippet});`; return `${name}.$on("${handler.name}", ${handler.snippet});`;
}); });

Loading…
Cancel
Save