wxml中:
<!--pages/todo/todo.wxml-->
<input type="text" placeholder="请输入计划"
value="{ {temp}}"
bindinput="inputHd"
bindconfirm="addTodo"
/>
<view>
<view class="item" wx:for="{ {list}}">
<switch type="checkbox" checked="{ {item.done}}" bindchange="switch2Change"/>
<text>{ {item.title}}</text>
<text bindtap="delTodo" data-item="{ {item}}">X</text>
</view>
</view>
js中:
// pages/todo/todo.js
Page({
/**
* 页面的初始数据
*/
data: {
temp:"",
list:[
{title:"学习vue",done:true},