File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change
1
+ import { Component , useState } from "@odoo/owl"
2
+
3
+ export class Card extends Component {
4
+ static template = "awesome_owl.card" ;
5
+ static props = {
6
+ title : String ,
7
+ content : String ,
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <templates xml : space =" preserve" >
3
+
4
+ <t t-name =" awesome_owl.card" >
5
+ <div class =" card d-inline-block m-2" style =" width: 18rem;" >
6
+ <div class =" card-body" >
7
+ <h5 class =" card-title" >
8
+ <t t-esc =" props.title" />
9
+ </h5 >
10
+ <p class =" card-text" >
11
+ <t t-out =" props.content" />
12
+ </p >
13
+ </div >
14
+ </div >
15
+ </t >
16
+
17
+ </templates >
Original file line number Diff line number Diff line change 1
1
/** @odoo -module **/
2
2
3
- import { Component , useState } from "@odoo/owl" ;
3
+ import { Component , markup } from "@odoo/owl" ;
4
4
import { Counter } from "./counter" ;
5
+ import { Card } from "./card" ;
5
6
6
7
export class Playground extends Component {
7
8
static template = "awesome_owl.playground" ;
8
- static components = { Counter } ;
9
+ static components = { Counter, Card } ;
10
+
11
+ card1Content = markup ( "<div>Some Text in div Tag</div>" ) ;
12
+ card2Content = "<div>Some Text in div Tag</div>" ;
9
13
}
Original file line number Diff line number Diff line change 4
4
<t t-name =" awesome_owl.playground" >
5
5
<Counter ></Counter >
6
6
<Counter ></Counter >
7
+ <Card title =" 'my title'" content =" card1Content" />
8
+ <Card title =" 'my title'" content =" card2Content" />
7
9
</t >
8
10
9
11
</templates >
You can’t perform that action at this time.
0 commit comments