I want to add class only when $_first evaluated to true
Example:
<div t-attf-class="carousel-item {{ $_first }}">
To be:
Incase True: <div t-attf-class="carousel-item active">
Incase of false: <div t-attf-class="carousel-item">
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to add class only when $_first evaluated to true
Example:
<div t-attf-class="carousel-item {{ $_first }}">
To be:
Incase True: <div t-attf-class="carousel-item active">
Incase of false: <div t-attf-class="carousel-item">
Try this one
<t t-foreach="records" t-as="rec">
<div t-attf-class="carousel-item #{ rec_first and 'active' or '' }">
</div>
</t>
it is not $_first you should replace $ with the value of t-asСоздайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!
Регистрация| Похожие посты | Ответы | Просмотры | Активность | |
|---|---|---|---|---|
|
1
апр. 25
|
4621 | |||
|
0
мар. 24
|
1934 | |||
|
0
окт. 22
|
3081 | |||
|
0
сент. 22
|
2397 | |||
|
1
июл. 22
|
6212 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
Thanks Parth, It's works.
Could you Please explain what the meaning of (and 'active' or ' ') and how odoo evaluate it