update mp-mvvm

This commit is contained in:
dntzhang 2018-12-07 09:43:21 +08:00
parent 1d5c30f841
commit e9b0173e45
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,9 @@
<view >
<view>
<label class="checkbox {{item.completed&&'completed'}}" wx:for="{{items}}">
<checkbox bindtap="checkboxChange" data-id="{{item.id}}" checked="{{item.completed}}"/>{{item.text}}<image bindtap="remove" data-id="{{item.id}}" src="./remove.png" />
<view bindtap="checkboxChange" data-id="{{item.id}}">
<checkbox checked="{{item.completed}}" />
{{item.text}}
</view>
<image bindtap="remove" data-id="{{item.id}}" src="./remove.png" />
</label>
</view>

View File

@ -5,7 +5,7 @@
<todo-list items="{{items}}" />
<view class="form">
<input class="input" bindinput="inputHandler" type="text" placeholder="Input your task" value="{{text}}" />
<button class="button" bindtap="tapHandler">Add{{items.length}}</button>
<button class="button" bindtap="tapHandler">Add{{items.length+1}}</button>
</view>
</view>