owl icon indicating copy to clipboard operation
owl copied to clipboard

Use t-slots on any HTMLElement (+ with attributes) and not just on the <t />

Open SimonGenin opened this issue 5 years ago • 1 comments

Actual use case:

framework:

<template t-name="Dropdown">
    ...
    <ul class="frameworky_dropdown_items_class">
        <t t-slot="items" />
    </ul>
</template>

note: frameworky_dropdown_items_class does nothing, it's just a hook for style.

end user

<Dropdown>
    ...
    <t t-set-slot="items">
        ...
    </t>
</Dropdown>

User: I can't give attributes to the <ul> and must rely on a class defined by the framework to style it 😢

Preferable use case:

framework:

<template t-name="Dropdown">
    ...
    <ul t-slot="items" />
</template>

end user

<template t-name="Dropdown">
        <ul t-slot="items" class="super_user_class another_one" whatever="something" />
</template>

User: 💯 🔥

SimonGenin avatar Oct 13 '20 09:10 SimonGenin

@brboi

@ged-odoo This is regarding the issue you discussed with Bruno yesterday.

SimonGenin avatar Oct 13 '20 09:10 SimonGenin