<!doctype html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1"><title>Vue • TodoMVC</title><linkrel="stylesheet"href="node_modules/todomvc-common/base.css"><linkrel="stylesheet"href="node_modules/todomvc-app-css/index.css"><!-- CSS overrides - remove if you don't need it --><linkrel="stylesheet"href="css/app.css"><scriptsrc="node_modules/vue/dist/vue.js"></script></head><body><sectionclass="todoapp"id="todoapp"><headerclass="header"><h1>todos</h1><inputclass="new-todo"placeholder="What needs to be done?"autofocus@keyup.enter="add"></header><!-- This section should be hidden by default and shown when there are todos --><sectionclass="main"><inputid="toggle-all"class="toggle-all"type="checkbox"@click="selectAll":checked="!getCountComputed"><labelfor="toggle-all">Mark all as complete</label><ulclass="todo-list"><!-- These are here just to show the structure of the list items --><!-- List items should get the class `editing` when editing and `completed` when marked as completed --><!--
使用中间变量,默认为null,editing的样式就取决于中间变量是否等于当前任务项
--><li:class="{completed:item.completed, editing: item === isTrue}"v-for="(item, index) in selectList":key="item.id"><divclass="view"><inputclass="toggle"type="checkbox"v-model="item.completed"><label@dblclick="isTrue = item">{{item.title}}</label><buttonclass="destroy"@click="del(index)"></button></div><inputclass="edit":value="item.title"@keyup.esc="isTrue = null"@keyup.enter="saveEdit(item, index, $event)"v-focus@blur="isTrue=null"></li></ul></section><!-- This footer should hidden by default and shown when there are todos --><footerclass="footer"><!-- This should be `0 items left` by default --><spanclass="todo-count"><strong>{{getCountComputed}}</strong> item left</span><!-- Remove this if you don't implement routing --><ulclass="filters"><li><a:class="{selected: isType===0}"href="#/"@click="isType = 0">All</a></li><li><a:class="{selected: isType===1}"href="#/active"@click="isType = 1">Active</a></li><li><a:class="{selected: isType===2}"href="#/completed"@click="isType = 2">Completed</a></li></ul><!-- Hidden if no completed items are left ↓ --><buttonclass="clear-completed"@click="delAll"v-show="getCountComputed !== list.length">Clear completed</button></footer></section><!-- Scripts here. Don't remove ↓ --><scriptsrc="node_modules/todomvc-common/base.js"></script><scriptsrc="js/app.js"></script></body></html>