mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
27629cedfa
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
23 lines
949 B
Plaintext
23 lines
949 B
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`Link component can render simple cases 1`] = `
|
|
"function anonymous(context, extra
|
|
) {
|
|
// Template name: \\"__template__1\\"
|
|
let utils = this.constructor.utils;
|
|
let scope = Object.create(context);
|
|
let h = this.h;
|
|
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);
|
|
extra.handlers['click__8__'] = extra.handlers['click__8__'] || function (e) {if (context.__owl__.status === 5){return}utils.getComponent(context)['navigate'](e);};
|
|
p7.on['click'] = extra.handlers['click__8__'];
|
|
const slot9 = this.constructor.slots[context.__owl__.slotId + '_' + 'default'];
|
|
if (slot9) {
|
|
slot9.call(this, context.__owl__.scope, Object.assign({}, extra, {parentNode: c7, parent: extra.parent || context}));
|
|
}
|
|
return vn7;
|
|
}"
|
|
`;
|