File tree Expand file tree Collapse file tree 5 files changed +37
-3
lines changed Expand file tree Collapse file tree 5 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 2929 'assets' : {
3030 'awesome_owl.assets_playground' : [
3131 ('include' , 'web._assets_helpers' ),
32+ ('include' , 'web._assets_backend_helpers' ),
3233 'web/static/src/scss/pre_variables.scss' ,
3334 'web/static/lib/bootstrap/scss/_variables.scss' ,
3435 ('include' , 'web._assets_bootstrap' ),
Original file line number Diff line number Diff line change 1+ import { useState , Component } from "@odoo/owl" ;
2+
3+ export class Counter extends Component {
4+ static template = "awesome_owl.Counter" ;
5+
6+ setup ( ) {
7+ this . state = useState ( { value : 0 } ) ;
8+ }
9+
10+ increment ( ) {
11+ this . state . value ++ ;
12+ }
13+
14+ }
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.Counter" >
5+ <p >Counter: <t t-esc =" state.value" /></p >
6+ <button class =" btn btn-primary" t-on-click =" increment" >Increment</button >
7+ </t >
8+
9+ </templates >
Original file line number Diff line number Diff line change 1- import { Component } from "@odoo/owl" ;
1+ import { Component , useState } from "@odoo/owl" ;
2+ import { Counter } from "./counter/counter"
23
34export class Playground extends Component {
4- static template = "awesome_owl.playground" ;
5+ static template = "awesome_owl.Playground" ;
6+ static components = { Counter} ;
7+
8+ setup ( ) {
9+ }
10+
511}
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<templates xml : space =" preserve" >
33
4- <t t-name =" awesome_owl.playground " >
4+ <t t-name =" awesome_owl.Playground " >
55 <div class =" p-3" >
66 hello world
77 </div >
8+ <div >
9+ <Counter />
10+ <Counter />
11+ </div >
812 </t >
913
1014</templates >
You can’t perform that action at this time.
0 commit comments