[REF] tools: use t-model in benchmarks

This commit is contained in:
Géry Debongnie
2019-06-13 23:31:30 +02:00
parent c481a73a76
commit 1f0457f69b
2 changed files with 5 additions and 11 deletions
+3 -9
View File
@@ -128,7 +128,9 @@ class App extends owl.Component {
removeMessage(event) { removeMessage(event) {
this.benchmark("remove message", () => { this.benchmark("remove message", () => {
const index = this.state.messages.findIndex(m => m.id === event.detail.id); const index = this.state.messages.findIndex(
m => m.id === event.detail.id
);
this.state.messages.splice(index, 1); this.state.messages.splice(index, 1);
}); });
} }
@@ -146,14 +148,6 @@ class App extends owl.Component {
clearLog() { clearLog() {
this.refs.log.innerHTML = ""; this.refs.log.innerHTML = "";
} }
toggleMultiple() {
this.state.multipleFlag = !this.state.multipleFlag;
}
toggleClear() {
this.state.clearAfterFlag = !this.state.clearAfterFlag;
}
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
+2 -2
View File
@@ -12,11 +12,11 @@
</div> </div>
<div class="flags"> <div class="flags">
<div> <div>
<input type="checkbox" id="multipleflag" t-on-change="toggleMultiple" t-att-checked="state.multipleFlag"/> <input type="checkbox" id="multipleflag" t-model="multipleFlag"/>
<label for="multipleflag">Do it 20x</label> <label for="multipleflag">Do it 20x</label>
</div> </div>
<div> <div>
<input type="checkbox" id="clearFlag" t-on-change="toggleClear" t-att-checked="state.clearAfterFlag"/> <input type="checkbox" id="clearFlag" t-model="clearAfterFlag" />
<label for="clearFlag">Clear after</label> <label for="clearFlag">Clear after</label>
</div> </div>
</div> </div>