mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
make t-set works with t-props
test by aku, fix by ged
This commit is contained in:
committed by
Géry Debongnie
parent
733d5f81e6
commit
9be0b65cd3
+6
-3
@@ -511,7 +511,7 @@ export class QWeb {
|
||||
}
|
||||
}
|
||||
|
||||
_formatExpression(e: string): string {
|
||||
_formatExpression(e: string, ctx?: Context): string {
|
||||
if (e in this.exprCache) {
|
||||
return this.exprCache[e];
|
||||
}
|
||||
@@ -537,7 +537,10 @@ export class QWeb {
|
||||
} else if (c.match(/\W/) && invar.length) {
|
||||
// TODO: Should check for possible spaces before dot
|
||||
if (chars[invarPos - 1] !== "." && RESERVED_WORDS.indexOf(invar) < 0) {
|
||||
invar = WORD_REPLACEMENT[invar] || "context['" + invar + "']";
|
||||
invar =
|
||||
WORD_REPLACEMENT[invar] ||
|
||||
(ctx && invar in ctx.variables && ctx.variables[invar]) ||
|
||||
"context['" + invar + "']";
|
||||
}
|
||||
r += invar;
|
||||
invar = "";
|
||||
@@ -847,7 +850,7 @@ const widgetDirective: Directive = {
|
||||
if (!val) {
|
||||
val = key;
|
||||
}
|
||||
return `${key}: ${qweb._formatExpression(val)}`;
|
||||
return `${key}: ${qweb._formatExpression(val, ctx)}`;
|
||||
})
|
||||
.join(",");
|
||||
props = "{" + innerProp + "}";
|
||||
|
||||
Reference in New Issue
Block a user