[IMP] qweb: allow multiclasses in t-att-class object form

the low level method htmlelement.classList.add does not accept multiple
classes in one string, which is why, in owl, the expression

`<div t-att-class="{'a b c': value}" />`

did not work as one might expect. It is however very convenient in real
life templates, so this commit improve owl by adding support for this
feature.

closes #813
This commit is contained in:
Géry Debongnie
2021-07-03 16:02:57 +02:00
committed by aab-odoo
parent 3a93370ab6
commit 27629cedfa
8 changed files with 104 additions and 18 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ exports[`Link component can render simple cases 1`] = `
let utils = this.constructor.utils;
let scope = Object.create(context);
let h = this.h;
let _5 = utils.toObj({'router-link-active':scope['isActive']});
let _5 = utils.toClassObj({'router-link-active':scope['isActive']});
let _6 = scope['href'];
let c7 = [], p7 = {key:7,attrs:{href: _6},class:_5,on:{}};
let vn7 = h('a', p7, c7);