[IMP] components: slots can now define default content

closes #554
This commit is contained in:
Géry Debongnie
2019-12-10 15:03:14 +01:00
committed by aab-odoo
parent 9145799ae9
commit bc455be720
4 changed files with 124 additions and 1 deletions
+13
View File
@@ -865,6 +865,19 @@ be considered the `default` slot. For example:
</div>
```
Slots can define a default content, in case the parent did not define them:
```xml
<div t-name="Parent">
<Child/>
</div>
<span t-name="Child">
<t t-slot="default">default content</t>
</span>
<!-- will be rendered as: <div><span>default content</span></div> -->
```
### Dynamic sub components
It is not common, but sometimes we need a dynamic component name. In this case,