File tree Expand file tree Collapse file tree 4 files changed +34
-1
lines changed Expand file tree Collapse file tree 4 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1+ import { useState , Component } from "@odoo/owl" ;
2+
3+ export class Card extends Component {
4+ static template = "awesome_owl.Card" ;
5+
6+ static props = {
7+ title : { type : String } ,
8+ content : { type : String }
9+ }
10+
11+ }
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-out =" 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 11import { Component , useState } from "@odoo/owl" ;
22import { Counter } from "./counter/counter"
3+ import { Card } from "./card/card" ;
34
45export class Playground extends Component {
56 static template = "awesome_owl.Playground" ;
6- static components = { Counter} ;
7+ static components = { Counter, Card } ;
78
89 setup ( ) {
910 }
Original file line number Diff line number Diff line change 99 <Counter />
1010 <Counter />
1111 </div >
12+ <div >
13+ <Card title =" 'card 1'" content =" 'content of card 1'" />
14+ <Card title =" 'card 2'" content =" 'content of card 2'" />
15+ </div >
1216 </t >
1317
1418</templates >
You can’t perform that action at this time.
0 commit comments