mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb, component: remove support for t-on on component node
This commit is contained in:
committed by
Géry Debongnie
parent
dd4848f602
commit
a1adfd5a1b
+4
-4
@@ -107,7 +107,6 @@ export interface ASTComponent {
|
||||
isDynamic: boolean;
|
||||
dynamicProps: string | null;
|
||||
props: { [name: string]: string };
|
||||
handlers: { [event: string]: string };
|
||||
slots: { [name: string]: AST };
|
||||
}
|
||||
|
||||
@@ -667,11 +666,12 @@ function parseComponent(node: Element, ctx: ParsingContext): AST | null {
|
||||
node.removeAttribute("t-props");
|
||||
|
||||
const props: ASTComponent["props"] = {};
|
||||
const handlers: ASTComponent["handlers"] = {};
|
||||
for (let name of node.getAttributeNames()) {
|
||||
const value = node.getAttribute(name)!;
|
||||
if (name.startsWith("t-on-")) {
|
||||
handlers[name.slice(5)] = value;
|
||||
throw new Error(
|
||||
"t-on is no longer supported on Component node. Consider passing a callback in props."
|
||||
);
|
||||
} else {
|
||||
props[name] = value;
|
||||
}
|
||||
@@ -715,7 +715,7 @@ function parseComponent(node: Element, ctx: ParsingContext): AST | null {
|
||||
slots.default = defaultContent;
|
||||
}
|
||||
}
|
||||
return { type: ASTType.TComponent, name, isDynamic, dynamicProps, props, handlers, slots };
|
||||
return { type: ASTType.TComponent, name, isDynamic, dynamicProps, props, slots };
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user