mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
06d852fcf9
Consider this scenario: - a variable v (with a body) is defined in a template - it is then passed to a sub component as a prop - and now, it is t-esc-ed. Before this commit, the displayed value was [object object], because the value actually passed to the sub component was a VDomArray (internal structure used to represent nodelists) This issue is actually quite a problem in practice, because values in a templates are translated, but not in attributes. Therefore, using a t-set directive with a body text content is the proper way to have translated values at runtime. We override in this commit the method toString of VDomArray to make sure it is properly displayed. Note that we considered changing the way props were generated (by trying to detect VDomArray, then calling vDomToString), but then the value would not be able to be used in a t-raw. Also, it is quite elegant to be able to format the VDomArray only at the end. closes #670