mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] parser: give t-set-slot="default" priority over the content
Currently, if a component has a default slot defined with t-set-slot, and also content that compiles to something (eg, text or even a comment node), the content takes priority over the t-set-slot. As t-set-slot is more explicity, it should have priority.
This commit is contained in:
committed by
Géry Debongnie
parent
d546244fc3
commit
ba1a270c93
@@ -781,8 +781,9 @@ function parseComponent(node: Element, ctx: ParsingContext): AST | null {
|
||||
|
||||
// default slot
|
||||
const defaultContent = parseChildNodes(clone, ctx);
|
||||
if (defaultContent) {
|
||||
slots = slots || {};
|
||||
slots = slots || {};
|
||||
// t-set-slot="default" has priority over content
|
||||
if (defaultContent && !slots.default) {
|
||||
slots.default = { content: defaultContent, on, attrs: null, scope: defaultSlotScope };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user