This code show a situation with a t-out defined with a array
import { Component, mount, xml, signal, proxy, onMounted } from "@odoo/owl";
class Root extends Component {
static template = xml`<t t-out="this.value().join('.')"/>`;
value = signal.Array([1,2]);
setup() {
onMounted(() => {
this.value().unshift(0);
});
}
}
mount(Root, document.body, { templates: TEMPLATES, dev: true });
It only works because we have a .join('.') on the t-out, making it a string. otherwise, without it, the output does not display the 0. This is likely to be caused by the fact that owl compares the reference of the array in the t-out, which did not change, so it does not update the content. not sure it is something that we should change, just putting the example here for discussion
This code show a situation with a t-out defined with a array
It only works because we have a
.join('.')on the t-out, making it a string. otherwise, without it, the output does not display the 0. This is likely to be caused by the fact that owl compares the reference of the array in the t-out, which did not change, so it does not update the content. not sure it is something that we should change, just putting the example here for discussion