Files
owl/examples/demo/message.js
T
Géry Debongnie 1f602512a5 improve demo app
2019-03-18 16:15:08 +01:00

23 lines
601 B
JavaScript

import { Counter } from "./counter.js";
export class Message extends odoo.core.Component {
inlineTemplate = `
<div class="message">
<span class="author"><t t-esc="props.author"/></span>
<span class="msg"><t t-esc="props.msg"/></span>
<button class="remove" t-on-click="removeMessage">Remove</button>
<t t-widget="Counter" t-props="{initialState: props.id}"/>
</div>`;
constructor(parent, props) {
super(parent, props);
this.widgets = { Counter };
}
removeMessage() {
this.trigger("remove_message", {
id: this.props.id
});
}
}