text: webpackJsonp([20],{IW3T:function(t,e,n){e=t.exports=n("FZ+f")(!1),e.push([t.i,'\n#gamePuzzle {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: auto;\n  z-index: 1001;\n  background: url("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1521730069680&di=10c544bda124f3a605391d763b8f6e07&imgtype=0&src=http%3A%2F%2Fbcs.img.r1.91.com%2Fdata%2Fupload%2F2014%2F11_07%2F10%2F201411071005579557.jpg") no-repeat center;\n}\n#gamePuzzle .wrapper {\n  padding: 1.335rem 0.2rem;\n}\n#gamePuzzle .puzzle-wrap {\n  margin: 1rem auto 0;\n  width: 9rem;\n  height: 9rem;\n  opacity: 0.95;\n}\n#gamePuzzle .puzzle-wrap .puzzle {\n  float: left;\n  width: 25%;\n  height: 25%;\n  font-size: 0.8rem;\n  text-align: center;\n  line-height: 2.4rem;\n  border: 1px solid #ccc;\n  -webkit-box-shadow: 1px 1px 4px;\n          box-shadow: 1px 1px 4px;\n  background: #a1e4e8;\n  text-shadow: 2px 2px 2px #b9b4b4;\n  color: #ba85ef;\n}\n#gamePuzzle .puzzle-wrap .puzzle-empty {\n  background: #ccc;\n  -webkit-box-shadow: inset 2px 2px 18px;\n          box-shadow: inset 2px 2px 18px;\n}\n#gamePuzzle .reset-btn {\n  width: 80%;\n  margin: 1rem auto 0;\n}\n',""])},YuAp:function(t,e,n){var s=n("IW3T");"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n("rjj0")("5efa2255",s,!0,{})},jNkN:function(t,e,n){"use strict";function s(t){n("YuAp")}Object.defineProperty(e,"__esModule",{value:!0});var i={name:"gamePuzzle",data:function(){return{puzzles:[]}},methods:{render:function(){var t=[],e=1;for(e;e<16;e++)t.push(e);t=t.sort(function(){return Math.random()-.5}),this.puzzles=t,this.puzzles.push("")},reset:function(){var t=[],e=1;for(e;e<16;e++)t.push(e);t=t.sort(function(){return Math.random()-.5}),t.push(""),this.puzzles=t},moveFn:function(t){var e=this.puzzles[t],n=this.puzzles[t-1],s=this.puzzles[t+1],i=this.puzzles[t-4],a=this.puzzles[t+4];""===n&&t%4?this.swap(t,t-1,e):""===s&&t%4!=3?this.swap(t,t+1,e):""===i?this.swap(t,t-4,e):""===a&&this.swap(t,t+4,e),this.passFn()},passFn:function(){if(""===this.puzzles[15]){this.puzzles.slice(0,15).every(function(t,e){return t===e+1})&&alert("恭喜，闯关成功！")}},swap:function(t,e,n){this.$set(this.puzzles,e,n),this.$set(this.puzzles,t,"")}},mounted:function(){this.render()}},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fadeIn"}},[n("div",{attrs:{id:"gamePuzzle"}},[n("my-header",{attrs:{fixed:"",title:"拼图游戏",isOpacity:""}},[n("a",{staticClass:"back-white",attrs:{slot:"left"},on:{click:function(e){t.$router.go(-1)}},slot:"left"})]),t._v(" "),n("div",{staticClass:"wrapper"},[n("ul",{staticClass:"puzzle-wrap"},[t._l(t.puzzles,function(e,s){return n("li",{class:{puzzle:!0,"puzzle-empty":!e},domProps:{textContent:t._s(e)},on:{click:function(e){t.moveFn(s)}}})}),t._v(" "),n("div",{staticClass:"clearfix"})],2),t._v(" "),n("mt-button",{staticClass:"reset-btn",attrs:{size:"large",type:"primary"},on:{click:t.reset}},[t._v("重置游戏")])],1)],1)])},r=[],o={render:a,staticRenderFns:r},p=o,u=n("VU/8"),l=s,z=u(i,p,!1,l,null,null);e.default=z.exports}});