1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-db615c40","chunk-6ded594d"],{"374b":function(t,e,o){"use strict";var n=o("6710"),i=o.n(n);i.a},"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(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.cancelEdit(e)}],blur:t.doneEdit}})])},i=[],r=(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}}}),s=r,a=o("2877"),d=Object(a["a"])(s,n,i,!1,null,null,null);e["default"]=d.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(e)}}})]),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=[],r=(o("a623"),o("4de4"),o("4160"),o("c975"),o("fb6a"),o("a434"),o("498a"),o("159b"),o("374e")),s="todos",a={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}))}},d=[{text:"工作流功能绘制工具",done:!1},{text:"工作流流转方法",done:!1},{text:"自动化代码优化",done:!1}],l={components:{Todo:r["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:a,todos:d}},computed:{allChecked:function(){return this.todos.every((function(t){return t.done}))},filteredTodos:function(){return a[this.visibility](this.todos)},remaining:function(){return this.todos.filter((function(t){return!t.done})).length}},methods:{setLocalStorage:function(){window.localStorage.setItem(s,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=l,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,r=o("c8d2");n({target:"String",proto:!0,forced:r("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("1d80"),i=o("5899"),r="["+i+"]",s=RegExp("^"+r+r+"*"),a=RegExp(r+r+"*$"),d=function(t){return function(e){var o=String(n(e));return 1&t&&(o=o.replace(s,"")),2&t&&(o=o.replace(a,"")),o}};t.exports={start:d(1),end:d(2),trim:d(3)}},6710:function(t,e,o){},a434:function(t,e,o){"use strict";var n=o("23e7"),i=o("23cb"),r=o("a691"),s=o("50c4"),a=o("7b0b"),d=o("65f0"),l=o("8418"),c=o("1dde"),u=o("ae40"),f=c("splice"),h=u("splice",{ACCESSORS:!0,0:0,1:2}),g=Math.max,p=Math.min,v=9007199254740991,m="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!f||!h},{splice:function(t,e){var o,n,c,u,f,h,y=a(this),x=s(y.length),k=i(t,x),b=arguments.length;if(0===b?o=n=0:1===b?(o=0,n=x-k):(o=b-2,n=p(g(r(e),0),x-k)),x+o-n>v)throw TypeError(m);for(c=d(y,n),u=0;u<n;u++)f=k+u,f in y&&l(c,u,y[f]);if(c.length=n,o<n){for(u=k;u<x-n;u++)f=u+n,h=u+o,f in y?y[h]=y[f]:delete y[h];for(u=x;u>x-n+o;u--)delete y[u-1]}else if(o>n)for(u=x-n;u>k;u--)f=u+n-1,h=u+o-1,f in y?y[h]=y[f]:delete y[h];for(u=0;u<o;u++)y[u+k]=arguments[u+2];return y.length=x-n+o,c}})},c8d2:function(t,e,o){var n=o("d039"),i=o("5899"),r="
";t.exports=function(t){return n((function(){return!!i[t]()||r[t]()!=r||i[t].name!==t}))}},fb6a:function(t,e,o){"use strict";var n=o("23e7"),i=o("861d"),r=o("e8b5"),s=o("23cb"),a=o("50c4"),d=o("fc6a"),l=o("8418"),c=o("b622"),u=o("1dde"),f=o("ae40"),h=u("slice"),g=f("slice",{ACCESSORS:!0,0:0,1:2}),p=c("species"),v=[].slice,m=Math.max;n({target:"Array",proto:!0,forced:!h||!g},{slice:function(t,e){var o,n,c,u=d(this),f=a(u.length),h=s(t,f),g=s(void 0===e?f:e,f);if(r(u)&&(o=u.constructor,"function"!=typeof o||o!==Array&&!r(o.prototype)?i(o)&&(o=o[p],null===o&&(o=void 0)):o=void 0,o===Array||void 0===o))return v.call(u,h,g);for(n=new(void 0===o?Array:o)(m(g-h,0)),c=0;h<g;h++,c++)h in u&&l(n,c,u[h]);return n.length=c,n}})}}]);
|