Skip to content

Commit 89e3ade

Browse files
committed
upd model
1 parent c46310f commit 89e3ade

7 files changed

+858
-218
lines changed

__html__/model.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717
</nav>
1818

19-
<div class="h-100 d-flex flex-center flex-column">
19+
<div id="root" class="h-100 d-flex flex-center flex-column">
2020
<div class="h1">Counter</div>
2121
<div class="m-2">Counter: {{ counter }}</div>
2222
<div class="m-2"><input class="text-center" type="text" data-model="counter"></div>
@@ -29,15 +29,15 @@
2929

3030
<script src="../lib/metro.js"></script>
3131
<script>
32+
Metro.welcome()
3233
var app = new Metro.Model({
3334
counter: 0,
3435
status: function () {
35-
console.log(this)
3636
return this.counter === 0 ? "Zero" : this.counter > 0 ? "Positive" : "Negative";
3737
}
3838
})
3939

40-
app.init()
40+
app.init("#root")
4141

4242
function updateCounter(operator) {
4343
operator === "-" ? app.data.counter-- : app.data.counter++

0 commit comments

Comments
 (0)