// 组件示例
const { Component, useState, mount } = owl;
class Hyc extends Component {
static template = "Greeter";
setup() {
this.state = useState({ word: 'Hello' });
}
toggle() {
this.state.word = this.state.word === 'Hi' ? 'Hello' : 'Hi';
}
}
// Main root component
class Root extends Component {
static components = { Hyc }; # 调用子组件
static template = "Root"
setup() {
this.state = useState({ name: 'World'});
}
}
// Application