Commit Graph

10 Commits

Author SHA1 Message Date
Géry Debongnie 79ea50aab9 [FIX] compiler: throw if using t-slot on a htmlelement tag
Before this commit, the tagName of a `t-slot` directive was ignored. So,
<t t-slot="owl">...</t>  and <div t-slot="owl">...</div> were basically
equivalent.

This is not really acceptable, since it most likely hides a developer
error. So, the question is what to do about it? There are two obvious
solutions:

- either make the `t-slot` directive behave as t-esc: the above example
would then be equivalent to <div><t t-slot="owl">...</t></div>
- or throw an error.

However, the first solution seems to be ambiguous when using a component
with slot props. How should the following code be interpreted?
   <SomeComponent a="a" b="b" t-slot="owl"/>
Should the 'a' and 'b' props be considered props for the component or
for the slot?

I guess we could make an exception for components, but it seems more
complicated than what it should be. Because of that, it seems simpler to
just throw an error.

closes #1354
2023-03-05 09:04:42 +01:00
Géry Debongnie 1fc88f626f [IMP] slots: add support for t-props on slots props 2022-06-07 09:30:45 +02:00
Géry Debongnie 3196b585fd [FIX] slots: process slot params/values like normal props 2022-02-11 10:46:44 +01:00
Samuel Degueldre 140818b5f9 [IMP] compiler: allow to declare default slot scope on component 2022-02-11 10:46:44 +01:00
Géry Debongnie 979712f84e [DOC] fix error in slot documentation 2022-02-11 10:46:44 +01:00
Géry Debongnie 82f6923a21 [DOC] add more information to the slots page 2022-02-11 10:46:44 +01:00
Géry Debongnie af426aa902 [DOC] misc small fixes
closes #827, #825, #822, #821
2021-02-03 13:44:04 +01:00
Géry Debongnie d83cfc12ee [IMP] qweb: the t-slot directive is now dynamic
It is useful for some kind of components to be able to use a completely
dynamic slot expression.
2020-10-30 15:31:03 +01:00
Géry Debongnie ae172d42e7 [IMP] slots: add new t-set-slot directive
This new t-set-slot directive is meant to replace t-set when we need to
define the content of a sub slot. All new code should use that
directive.

The old t-set directive is still supported for now, but this should be
removed when we publish Owl 2.0.
2020-04-06 15:42:32 +02:00
Géry Debongnie 69d35abe4f [DOC] add a dedicated page on slots
closes #640
2020-02-17 09:11:04 +01:00