加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
indexVue.js 4.99 KB
一键复制 编辑 原始数据 按行查看 历史
Bd999 提交于 2019-10-28 20:04 . v1.0.0 first draft
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([,,,,function(e,t,n){const i=n(5),s=n(6);window.aKeyboardVue={keyboard:i,numberKeyboard:s}},function(e,t){e.exports={props:{fixedBottomCenter:Boolean,inputOn:Object,onclick:Object},template:'\n <div :class="{\'akeyboard-keyboard\': true, \'akeyboard-keyboard-fixedBottomCenter\': fixedBottomCenter}">\n <div v-for="row of keys" class="akeyboard-keyboard-innerKeys">\n <div v-for="key in row" :class="[\'akeyboard-keyboard-keys\', \'akeyboard-keyboard-keys-\' + key]" @click="handleClick(key)">\n <span v-if="key === \'Shift\' && isShift">SHIFT</span>\n <span v-else>{{ key }}</span>\n </div>\n </div>\n </div>\n ',data(){let e=[];for(let t=1;t<10;t++)e.push(t.toString());e.push("0");const t=[["`"].concat(e).concat(["-","=","Delete"]),["Tab","q","w","e","r","t","y","u","i","o","p","[","]","\\"],["Caps","a","s","d","f","g","h","j","k","l",";","'","Enter"],["Shift","z","x","c","v","b","n","m",",",".","/","Shift"],["Space"]];let n;const i=[],s=[];for(let e=0;e<t.length;e++){i.push([]),s.push([]),n=t[e];for(let t=0;t<n.length;t++)if(1!==n[t].length)i[e].push(n[t]),s[e].push(n[t]);else{switch(s[e].push(n[t].toUpperCase()),n[t]){case"`":i[e].push("~");continue;case"1":i[e].push("!");continue;case"2":i[e].push("@");continue;case"3":i[e].push("#");continue;case"4":i[e].push("$");continue;case"5":i[e].push("%");continue;case"6":i[e].push("^");continue;case"7":i[e].push("&");continue;case"8":i[e].push("*");continue;case"9":i[e].push("(");continue;case"0":i[e].push(")");continue;case"-":i[e].push("_");continue;case"=":i[e].push("+");continue;case"[":i[e].push("{");continue;case"]":i[e].push("}");continue;case"\\":i[e].push("|");continue;case";":i[e].push(":");continue;case"'":i[e].push('"');continue;case",":i[e].push("<");continue;case".":i[e].push(">");continue;case"/":i[e].push("?");continue}i[e].push(n[t].toUpperCase())}}return{keys:t,key:JSON.parse(JSON.stringify(t)),shiftKey:i,capsKey:s,isShift:!1,isCaps:!1}},methods:{handleClick(e){if(this.onclick&&this.onclick["*"])return void this.onclick["*"].bind(this)();if(this.onclick&&this.onclick[e])return void this.onclick[e].bind(this)();const t=document.querySelector(this.inputOn.inputEl);if("Shift"===e){if(this.isCaps)return;return this.isShift?(this.isShift=!1,void(this.keys=JSON.parse(JSON.stringify(this.key)))):(this.isShift=!0,void(this.keys=JSON.parse(JSON.stringify(this.shiftKey))))}if("Caps"===e){if(this.isShift)return;return this.isCaps?(this.isCaps=!1,void(this.keys=JSON.parse(JSON.stringify(this.key)))):(this.isCaps=!0,void(this.keys=JSON.parse(JSON.stringify(this.capsKey))))}if(this.inputOn){switch(e){case"Delete":return void(t[this.inputOn.inputType]=t[this.inputOn.inputType].substr(0,t[this.inputOn.inputType].length-1));case"Tab":return void(t[this.inputOn.inputType]+=" ");case"Enter":return void(t[this.inputOn.inputType]+="\n");case"Space":return void(t[this.inputOn.inputType]+=" ")}t[this.inputOn.inputType]+=e}}}}},function(e,t){e.exports={props:{fixedBottomCenter:Boolean,inputOn:Object,onclick:Object},template:'\n <div :class="{\'akeyboard-numberKeyboard\': true, \'akeyboard-keyboard-fixedBottomCenter\': fixedBottomCenter}">\n <div v-for="row of keys" class="akeyboard-keyboard-innerKeys">\n <div v-for="key in row" :class="[\'akeyboard-keyboard-keys\', \'akeyboard-numberKeyboard-keys\', \'akeyboard-keyboard-keys-\' + key]" @click="handleClick(key)">\n {{ key }}\n </div>\n </div>\n </div>\n ',data(){const e=[];let t=[];for(let n=1;n<10;n++)t.push(n),n%3==0&&(e.push(t),t=[]);return e.push([0,"Delete"],["Enter"]),{keys:e}},methods:{handleClick(e){if(this.onclick&&this.onclick["*"])return void this.onclick["*"].bind(this)();if(this.onclick&&this.onclick[e])return void this.onclick[e].bind(this)();const t=document.querySelector(this.inputOn.inputEl);if(this.inputOn){switch(e){case"Delete":return void(t[this.inputOn.inputType]=t[this.inputOn.inputType].substr(0,t[this.inputOn.inputType].length-1));case"Enter":return void(t[this.inputOn.inputType]+="\n")}t[this.inputOn.inputType]+=e}}}}}]);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化