1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0f492bc0","chunk-6ded594d"],{"374b":function(t,e,o){"use strict";o("6710")},"374e":function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("li",{staticClass:"todo",class:{completed:t.todo.done,editing:t.editing}},[o("div",{staticClass:"view"},[o("input",{staticClass:"toggle",attrs:{type:"checkbox"},domProps:{checked:t.todo.done},on:{change:function(e){return t.toggleTodo(t.todo)}}}),o("label",{domProps:{textContent:t._s(t.todo.text)},on:{dblclick:function(e){t.editing=!0}}}),o("button",{staticClass:"destroy",on:{click:function(e){return t.deleteTodo(t.todo)}}})]),o("input",{directives:[{name:"show",rawName:"v-show",value:t.editing,expression:"editing"},{name:"focus",rawName:"v-focus",value:t.editing,expression:"editing"}],staticClass:"edit",domProps:{value:t.todo.text},on:{keyup:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.doneEdit.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.cancelEdit.apply(null,arguments)}],blur:t.doneEdit}})])},i=[],s=(o("498a"),{name:"Todo",directives:{focus:function(t,e,o){var n=e.value,i=o.context;n&&i.$nextTick((function(){t.focus()}))}},props:{todo:{type:Object,default:function(){return{}}}},data:function(){return{editing:!1}},methods:{deleteTodo:function(t){this.$emit("deleteTodo",t)},editTodo:function(t){var e=t.todo,o=t.value;this.$emit("editTodo",{todo:e,value:o})},toggleTodo:function(t){this.$emit("toggleTodo",t)},doneEdit:function(t){var e=t.target.value.trim(),o=this.todo;e?this.editing&&(this.editTodo({todo:o,value:e}),this.editing=!1):this.deleteTodo({todo:o})},cancelEdit:function(t){t.target.value=this.todo.text,this.editing=!1}}}),r=s,d=o("2877"),l=Object(d["a"])(r,n,i,!1,null,null,null);e["default"]=l.exports},"3eb4":function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("section",{staticClass:"todoapp"},[o("header",{staticClass:"header"},[o("input",{staticClass:"new-todo",attrs:{autocomplete:"off",placeholder:"Todo List"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.addTodo.apply(null,arguments)}}})]),o("section",{directives:[{name:"show",rawName:"v-show",value:t.todos.length,expression:"todos.length"}],staticClass:"main"},[o("input",{staticClass:"toggle-all",attrs:{id:"toggle-all",type:"checkbox"},domProps:{checked:t.allChecked},on:{change:function(e){return t.toggleAll({done:!t.allChecked})}}}),o("label",{attrs:{for:"toggle-all"}}),o("ul",{staticClass:"todo-list"},t._l(t.filteredTodos,(function(e,n){return o("todo",{key:n,attrs:{todo:e},on:{toggleTodo:t.toggleTodo,editTodo:t.editTodo,deleteTodo:t.deleteTodo}})})),1)]),o("footer",{directives:[{name:"show",rawName:"v-show",value:t.todos.length,expression:"todos.length"}],staticClass:"footer"},[o("span",{staticClass:"todo-count"},[o("strong",[t._v(t._s(t.remaining))]),t._v(" "+t._s(t._f("pluralize")(t.remaining,"item"))+" left ")]),o("ul",{staticClass:"filters"},t._l(t.filters,(function(e,n){return o("li",{key:n},[o("a",{class:{selected:t.visibility===n},on:{click:function(e){e.preventDefault(),t.visibility=n}}},[t._v(t._s(t._f("capitalize")(n)))])])})),0)])])},i=[],s=(o("4de4"),o("d3b7"),o("fb6a"),o("e9c4"),o("498a"),o("a434"),o("159b"),o("374e")),r="todos",d={all:function(t){return t},active:function(t){return t.filter((function(t){return!t.done}))},completed:function(t){return t.filter((function(t){return t.done}))}},l=[{text:"工作流功能绘制工具",done:!1},{text:"工作流流转方法",done:!1},{text:"自动化代码优化",done:!1}],a={components:{Todo:s["default"]},filters:{pluralize:function(t,e){return 1===t?e:e+"s"},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1)}},data:function(){return{visibility:"all",filters:d,todos:l}},computed:{allChecked:function(){return this.todos.every((function(t){return t.done}))},filteredTodos:function(){return d[this.visibility](this.todos)},remaining:function(){return this.todos.filter((function(t){return!t.done})).length}},methods:{setLocalStorage:function(){window.localStorage.setItem(r,JSON.stringify(this.todos))},addTodo:function(t){var e=t.target.value;e.trim()&&(this.todos.push({text:e,done:!1}),this.setLocalStorage()),t.target.value=""},toggleTodo:function(t){t.done=!t.done,this.setLocalStorage()},deleteTodo:function(t){this.todos.splice(this.todos.indexOf(t),1),this.setLocalStorage()},editTodo:function(t){var e=t.todo,o=t.value;e.text=o,this.setLocalStorage()},clearCompleted:function(){this.todos=this.todos.filter((function(t){return!t.done})),this.setLocalStorage()},toggleAll:function(t){var e=this,o=t.done;this.todos.forEach((function(t){t.done=o,e.setLocalStorage()}))}}},c=a,u=(o("374b"),o("2877")),f=Object(u["a"])(c,n,i,!1,null,null,null);e["default"]=f.exports},"498a":function(t,e,o){"use strict";var n=o("23e7"),i=o("58a8").trim,s=o("c8d2");n({target:"String",proto:!0,forced:s("trim")},{trim:function(){return i(this)}})},5899:function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},"58a8":function(t,e,o){var n=o("e330"),i=o("1d80"),s=o("577e"),r=o("5899"),d=n("".replace),l="["+r+"]",a=RegExp("^"+l+l+"*"),c=RegExp(l+l+"*$"),u=function(t){return function(e){var o=s(i(e));return 1&t&&(o=d(o,a,"")),2&t&&(o=d(o,c,"")),o}};t.exports={start:u(1),end:u(2),trim:u(3)}},6710:function(t,e,o){},a434:function(t,e,o){"use strict";var n=o("23e7"),i=o("da84"),s=o("23cb"),r=o("5926"),d=o("07fa"),l=o("7b0b"),a=o("65f0"),c=o("8418"),u=o("1dde"),f=u("splice"),h=i.TypeError,g=Math.max,p=Math.min,v=9007199254740991,m="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!f},{splice:function(t,e){var o,n,i,u,f,k,x=l(this),y=d(x),T=s(t,y),b=arguments.length;if(0===b?o=n=0:1===b?(o=0,n=y-T):(o=b-2,n=p(g(r(e),0),y-T)),y+o-n>v)throw h(m);for(i=a(x,n),u=0;u<n;u++)f=T+u,f in x&&c(i,u,x[f]);if(i.length=n,o<n){for(u=T;u<y-n;u++)f=u+n,k=u+o,f in x?x[k]=x[f]:delete x[k];for(u=y;u>y-n+o;u--)delete x[u-1]}else if(o>n)for(u=y-n;u>T;u--)f=u+n-1,k=u+o-1,f in x?x[k]=x[f]:delete x[k];for(u=0;u<o;u++)x[u+T]=arguments[u+2];return x.length=y-n+o,i}})},c8d2:function(t,e,o){var n=o("5e77").PROPER,i=o("d039"),s=o("5899"),r="
";t.exports=function(t){return i((function(){return!!s[t]()||r[t]()!==r||n&&s[t].name!==t}))}}}]);
|