mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
23 lines
600 B
JavaScript
23 lines
600 B
JavaScript
import { Counter } from "./counter.js";
|
|
|
|
export class Message extends owl.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
|
|
});
|
|
}
|
|
}
|