File tree Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,16 @@ export class Card extends Component {
44 static template = "awesome_owl.Card" ;
55
66 static props = {
7- title : { type : String } ,
8- content : { type : String }
7+ title : { type : String } ,
8+ slots : { type : Object , optional : true }
9+ }
10+
11+ setup ( ) {
12+ this . state = useState ( { isOpen : true } )
13+ }
14+
15+ toggle ( ) {
16+ this . state . isOpen = ! this . state . isOpen ;
917 }
1018
1119}
Original file line number Diff line number Diff line change 66 <div class =" card-body" >
77 <h5 class =" card-title" >
88 <t t-out =" props.title" />
9+ <button class =" btn btn-primary" t-on-click =" toggle" >Toggle</button >
910 </h5 >
10- <p class =" card-text" >
11- <t t-out = " props.content " />
11+ <p class =" card-text" t-if = " state.isOpen " >
12+ <t t-slot = " default " />
1213 </p >
1314 </div >
1415 </div >
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export class Playground extends Component {
99
1010 setup ( ) {
1111 this . value1 = "<div class='text-primary'>test</div>" ;
12- this . value2 = markup ( "<a href='odoo.com'>test2</a>" ) ;
12+ this . value2 = markup ( "<a href='http:// odoo.com'>test2</a>" ) ;
1313 this . state = useState ( { sum : 0 } ) ;
1414 }
1515
Original file line number Diff line number Diff line change 1010 <Counter onChange.bind=" implementSum" />
1111 </div >
1212 <div >
13- <Card title =" 'card 1'" content =" value1" />
14- <Card title =" 'card 2'" content =" value2" />
13+ <Card title =" 'card 1'" >
14+ <t t-out =" value1" />
15+ </Card >
16+ <Card title =" 'card 2'" >
17+ <t t-out =" value2" />
18+ </Card >
19+ </div >
20+ <div >
21+ <Card title =" 'card 3'" >
22+ <Counter onChange.bind=" implementSum" />
23+ </Card >
1524 </div >
1625 <div >
1726 The sum is: <t t-esc =" state.sum" />
You can’t perform that action at this time.
0 commit comments