[FIX] component: issue with t-slot,t-set,t-value, but no t-foreach

closes #232
This commit is contained in:
Géry Debongnie
2019-07-08 16:41:29 +02:00
parent 8e1aa71436
commit 9f1e64d399
3 changed files with 90 additions and 12 deletions
+7 -2
View File
@@ -590,8 +590,13 @@ QWeb.addDirective({
}
}
const scopeVars =
hasSlots && ctx.scopeVars.length ? `Object.assign({}, scope), {${varDefs.join(",")}}` : "";
let scopeVars = "";
if (hasSlots) {
scopeVars += ctx.scopeVars.length ? `Object.assign({}, scope)` : varDefs.length ? `{}` : "";
if (varDefs.length) {
scopeVars += `, {${varDefs.join(",")}}`;
}
}
ctx.addLine(`def${defID} = w${componentID}.__prepare(${scopeVars});`);
// hack: specify empty remove hook to prevent the node from being removed from the DOM
ctx.addLine(