File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
awesome_owl/static/src/card Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
/** @odoo -module **/
2
2
3
- import { Component } from "@odoo/owl" ;
3
+ import { Component , useState } from "@odoo/owl" ;
4
4
5
5
export class Card extends Component {
6
6
static template = "awesome_owl.card" ;
@@ -14,4 +14,12 @@ export class Card extends Component {
14
14
}
15
15
} ;
16
16
17
+ setup ( ) {
18
+ this . state = useState ( { displayed : false } ) ;
19
+ }
20
+
21
+ toggleDisplay ( ) {
22
+ this . state . displayed = ! this . state . displayed ;
23
+ }
24
+
17
25
}
Original file line number Diff line number Diff line change 3
3
4
4
<t t-name =" awesome_owl.card" >
5
5
<div class =" p-3 border" >
6
- <h3 ><t t-out =" props.title" /></h3 >
7
- <t t-slot =" default" />
6
+ <h3 ><t t-out =" props.title" /><button t-on-click = " toggleDisplay " >Toggle</ button >< /h3 >
7
+ <t t-if = " state.displayed " t- slot =" default" />
8
8
</div >
9
9
</t >
10
10
You can’t perform that action at this time.
0 commit comments