-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path21.js
1 lines (1 loc) · 25.9 KB
/
21.js
1
webpackJsonp([21],{348:function(e,t,n){"use strict";function i(e){n(856)}Object.defineProperty(t,"__esModule",{value:!0});var r=n(570),a=n(763),s=n(73),o=i,l=s(r.a,a.a,!1,o,"data-v-2dadaac0",null);t.default=l.exports},570:function(e,t,n){"use strict";var i=n(729),r=(n.n(i),n(830)),a=n(735),s=(n.n(a),n(728)),o=(n.n(s),n(730)),l=(n.n(o),n(733));n.n(l);t.a={name:"MybatisSqlLog",data:function(){return{code3:'#在springboot项目的application.yml配置文件中指定mybatis全局配置文件的路径\nmybatis:\n config-location: classpath:mybatis-config.xml\n\n#在mybatis全局配置文件中设置打印sql的setting配置\n<configuration>\n <settings>\n <setting name="mapUnderscoreToCamelCase" value="true"/>\n \x3c!-- 打印查询语句 --\x3e\n <setting name="logImpl" value="STDOUT_LOGGING" />\n </settings>\n</configuration>',code2:"logging.level.com.kakaluote.mybaisplusdemo.mapper: debug",code1:"mybatis:\n\tconfiguration:\n\t\tlog-impl: org.apache.ibatis.logging.stdout.StdOutImpl",activeName:""}},methods:{highlighter:function(e){return n.i(i.highlight)(e,i.languages.js)}},components:{PrismEditor:r.a}}},631:function(e,t,n){t=e.exports=n(7)(void 0),t.push([e.i,"code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}",""])},633:function(e,t,n){t=e.exports=n(7)(void 0),t.push([e.i,".prism-editor-wrapper{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;overflow:auto;tab-size:1.5em;-moz-tab-size:1.5em}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.prism-editor-wrapper .prism-editor__textarea{color:transparent!important}.prism-editor-wrapper .prism-editor__textarea::-moz-selection{background-color:#accef7!important;color:transparent!important}.prism-editor-wrapper .prism-editor__textarea::selection{background-color:#accef7!important;color:transparent!important}}.prism-editor-wrapper .prism-editor__container{position:relative;text-align:left;box-sizing:border-box;padding:0;overflow:hidden;width:100%}.prism-editor-wrapper .prism-editor__line-numbers{height:100%;overflow:hidden;-ms-flex-negative:0;flex-shrink:0;padding-top:4px;margin-top:0;margin-right:10px}.prism-editor-wrapper .prism-editor__line-number{text-align:right;white-space:nowrap}.prism-editor-wrapper .prism-editor__textarea{position:absolute;top:0;left:0;height:100%;width:100%;resize:none;color:inherit;overflow:hidden;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-text-fill-color:transparent}.prism-editor-wrapper .prism-editor__editor,.prism-editor-wrapper .prism-editor__textarea{margin:0;border:0;background:none;box-sizing:inherit;display:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-variant-ligatures:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;-moz-tab-size:inherit;tab-size:inherit;text-indent:inherit;text-rendering:inherit;text-transform:inherit;white-space:pre-wrap;word-wrap:keep-all;overflow-wrap:break-word;padding:0}.prism-editor-wrapper .prism-editor__textarea--empty{-webkit-text-fill-color:inherit!important}.prism-editor-wrapper .prism-editor__editor{position:relative;pointer-events:none}",""])},659:function(e,t,n){t=e.exports=n(7)(void 0),t.push([e.i,"",""])},728:function(e,t){Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},729:function(e,t,n){(function(t){var n="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},i=function(e){function t(e,t,n,i){this.type=e,this.content=t,this.alias=n,this.length=0|(i||"").length}function n(e,t,n,i){e.lastIndex=t;var r=e.exec(n);if(r&&i&&r[1]){var a=r[1].length;r.index+=a,r[0]=r[0].slice(a)}return r}function i(e,r,o,l,c,u){for(var d in o)if(o.hasOwnProperty(d)&&o[d]){var p=o[d];p=Array.isArray(p)?p:[p];for(var g=0;g<p.length;++g){if(u&&u.cause==d+","+g)return;var f=p[g],m=f.inside,v=!!f.lookbehind,y=!!f.greedy,b=f.alias;if(y&&!f.pattern.global){var k=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,k+"g")}for(var x=f.pattern||f,w=l.next,_=c;w!==r.tail&&!(u&&_>=u.reach);_+=w.value.length,w=w.next){var F=w.value;if(r.length>e.length)return;if(!(F instanceof t)){var $,A=1;if(y){if(!($=n(x,_,e,v))||$.index>=e.length)break;var S=$.index,C=$.index+$[0].length,E=_;for(E+=w.value.length;S>=E;)w=w.next,E+=w.value.length;if(E-=w.value.length,_=E,w.value instanceof t)continue;for(var P=w;P!==r.tail&&(E<C||"string"==typeof P.value);P=P.next)A++,E+=P.value.length;A--,F=e.slice(_,E),$.index-=_}else if(!($=n(x,0,F,v)))continue;var S=$.index,z=$[0],L=F.slice(0,S),N=F.slice(S+z.length),j=_+F.length;u&&j>u.reach&&(u.reach=j);var K=w.prev;L&&(K=a(r,K,L),_+=L.length),s(r,K,A);var O=new t(d,m?h.tokenize(z,m):z,b,z);if(w=a(r,K,O),N&&a(r,w,N),A>1){var D={cause:d+","+g,reach:j};i(e,r,o,w.prev,_,D),u&&D.reach>u.reach&&(u.reach=D.reach)}}}}}}function r(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function a(e,t,n){var i=t.next,r={value:n,prev:t,next:i};return t.next=r,i.prev=r,e.length++,r}function s(e,t,n){for(var i=t.next,r=0;r<n&&i!==e.tail;r++)i=i.next;t.next=i,i.prev=t,e.length-=r}function o(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}function l(){h.manual||h.highlightAll()}var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,u=0,d={},h={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof t?new t(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++u}),e.__id},clone:function e(t,n){n=n||{};var i,r;switch(h.util.type(t)){case"Object":if(r=h.util.objId(t),n[r])return n[r];i={},n[r]=i;for(var a in t)t.hasOwnProperty(a)&&(i[a]=e(t[a],n));return i;case"Array":return r=h.util.objId(t),n[r]?n[r]:(i=[],n[r]=i,t.forEach(function(t,r){i[r]=e(t,n)}),i);default:return t}},getLanguage:function(e){for(;e;){var t=c.exec(e.className);if(t)return t[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,t){e.className=e.className.replace(RegExp(c,"gi"),""),e.classList.add("language-"+t)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(i){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(i.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var i="no-"+t;e;){var r=e.classList;if(r.contains(t))return!0;if(r.contains(i))return!1;e=e.parentElement}return!!n}},languages:{plain:d,plaintext:d,text:d,txt:d,extend:function(e,t){var n=h.util.clone(h.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){i=i||h.languages;var r=i[e],a={};for(var s in r)if(r.hasOwnProperty(s)){if(s==t)for(var o in n)n.hasOwnProperty(o)&&(a[o]=n[o]);n.hasOwnProperty(s)||(a[s]=r[s])}var l=i[e];return i[e]=a,h.languages.DFS(h.languages,function(t,n){n===l&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,i,r){r=r||{};var a=h.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],i||s);var o=t[s],l=h.util.type(o);"Object"!==l||r[a(o)]?"Array"!==l||r[a(o)]||(r[a(o)]=!0,e(o,n,s,r)):(r[a(o)]=!0,e(o,n,null,r))}}},plugins:{},highlightAll:function(e,t){h.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var i={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};h.hooks.run("before-highlightall",i),i.elements=Array.prototype.slice.apply(i.container.querySelectorAll(i.selector)),h.hooks.run("before-all-elements-highlight",i);for(var r,a=0;r=i.elements[a++];)h.highlightElement(r,!0===t,i.callback)},highlightElement:function(t,n,i){function r(e){c.highlightedCode=e,h.hooks.run("before-insert",c),c.element.innerHTML=c.highlightedCode,h.hooks.run("after-highlight",c),h.hooks.run("complete",c),i&&i.call(c.element)}var a=h.util.getLanguage(t),s=h.languages[a];h.util.setLanguage(t,a);var o=t.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&h.util.setLanguage(o,a);var l=t.textContent,c={element:t,language:a,grammar:s,code:l};if(h.hooks.run("before-sanity-check",c),o=c.element.parentElement,o&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!c.code)return h.hooks.run("complete",c),void(i&&i.call(c.element));if(h.hooks.run("before-highlight",c),!c.grammar)return void r(h.util.encode(c.code));if(n&&e.Worker){var u=new Worker(h.filename);u.onmessage=function(e){r(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else r(h.highlight(c.code,c.grammar,c.language))},highlight:function(e,n,i){var r={code:e,grammar:n,language:i};if(h.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=h.tokenize(r.code,r.grammar),h.hooks.run("after-tokenize",r),t.stringify(h.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var s in n)t[s]=n[s];delete t.rest}var l=new r;return a(l,l.head,e),i(e,l,t,l.head,0),o(l)},hooks:{all:{},add:function(e,t){var n=h.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=h.hooks.all[e];if(n&&n.length)for(var i,r=0;i=n[r++];)i(t)}},Token:t};if(e.Prism=h,t.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var i="";return t.forEach(function(t){i+=e(t,n)}),i}var r={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(r.classes,a):r.classes.push(a)),h.hooks.run("wrap",r);var s="";for(var o in r.attributes)s+=" "+o+'="'+(r.attributes[o]||"").replace(/"/g,""")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+s+">"+r.content+"</"+r.tag+">"},!e.document)return e.addEventListener?(h.disableWorkerMessageHandler||e.addEventListener("message",function(t){var n=JSON.parse(t.data),i=n.language,r=n.code,a=n.immediateClose;e.postMessage(h.highlight(r,h.languages[i],i)),a&&e.close()},!1),h):h;var p=h.util.currentScript();if(p&&(h.filename=p.src,p.hasAttribute("data-manual")&&(h.manual=!0)),!h.manual){var g=document.readyState;"loading"===g||"interactive"===g&&p&&p.defer?document.addEventListener("DOMContentLoaded",l):window.requestAnimationFrame?window.requestAnimationFrame(l):window.setTimeout(l,16)}return h}(n);void 0!==e&&e.exports&&(e.exports=i),void 0!==t&&(t.Prism=i)}).call(t,n(11))},730:function(e,t){Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript},733:function(e,t,n){var i=n(631);"string"==typeof i&&(i=[[e.i,i,""]]);n(14)(i,{});i.locals&&(e.exports=i.locals)},735:function(e,t,n){var i=n(633);"string"==typeof i&&(i=[[e.i,i,""]]);n(14)(i,{});i.locals&&(e.exports=i.locals)},763:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-card",{staticClass:"box-card"},[e._v("\n 三种方法,总有一个方法可以正确打印SQL日志。\n ")]),e._v(" "),n("el-collapse",{attrs:{accordion:""},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[n("el-collapse-item",{attrs:{title:"方式1",name:"1"}},[n("prism-editor",{staticClass:"my-editor height-300",attrs:{"aria-disabled":"",highlight:e.highlighter,"line-numbers":"",readonly:!0,tabSize:4},model:{value:e.code1,callback:function(t){e.code1=t},expression:"code1"}})],1),e._v(" "),n("el-collapse-item",{attrs:{title:"方式2",name:"2"}},[n("prism-editor",{staticClass:"my-editor height-300",attrs:{"aria-disabled":"",highlight:e.highlighter,"line-numbers":"",readonly:!0,tabSize:4},model:{value:e.code2,callback:function(t){e.code2=t},expression:"code2"}})],1),e._v(" "),n("el-collapse-item",{attrs:{title:"方式3",name:"3"}},[n("prism-editor",{staticClass:"my-editor height-300",attrs:{"aria-disabled":"",highlight:e.highlighter,"line-numbers":"",readonly:!0,tabSize:4},model:{value:e.code3,callback:function(t){e.code3=t},expression:"code3"}})],1)],1)],1)},r=[],a={render:i,staticRenderFns:r};t.a=a},830:function(e,t,n){"use strict";function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},i.apply(this,arguments)}n.d(t,"a",function(){return o});var r=n(3),a="undefined"!=typeof window&&navigator&&/Win/i.test(navigator.platform),s="undefined"!=typeof window&&navigator&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),o=r.default.extend({props:{lineNumbers:{type:Boolean,default:!1},autoStyleLineNumbers:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},value:{type:String,default:""},highlight:{type:Function,required:!0},tabSize:{type:Number,default:2},insertSpaces:{type:Boolean,default:!0},ignoreTabKey:{type:Boolean,default:!1},placeholder:{type:String,default:""}},data:function(){return{capture:!0,history:{stack:[],offset:-1},lineNumbersHeight:"20px",codeData:""}},watch:{value:{immediate:!0,handler:function(e){this.codeData=e||""}},content:{immediate:!0,handler:function(){var e=this;this.lineNumbers&&this.$nextTick(function(){e.setLineNumbersHeight()})}},lineNumbers:function(){var e=this;this.$nextTick(function(){e.styleLineNumbers(),e.setLineNumbersHeight()})}},computed:{isEmpty:function(){return 0===this.codeData.length},content:function(){return this.highlight(this.codeData)+"<br />"},lineNumbersCount:function(){return this.codeData.split(/\r\n|\n/).length}},mounted:function(){this._recordCurrentState(),this.styleLineNumbers()},methods:{setLineNumbersHeight:function(){this.lineNumbersHeight=getComputedStyle(this.$refs.pre).height},styleLineNumbers:function(){if(this.lineNumbers&&this.autoStyleLineNumbers){var e=this.$refs.pre,t=this.$el.querySelector(".prism-editor__line-numbers"),n=window.getComputedStyle(e);this.$nextTick(function(){var i="border-top-left-radius",r="border-bottom-left-radius";if(t){t.style[i]=n[i],t.style[r]=n[r],e.style[i]="0",e.style[r]="0";["background-color","margin-top","padding-top","font-family","font-size","line-height"].forEach(function(e){t.style[e]=n[e]}),t.style["margin-bottom"]="-"+n["padding-top"]}})}},_recordCurrentState:function(){var e=this.$refs.textarea;if(e){var t=e.value,n=e.selectionStart,i=e.selectionEnd;this._recordChange({value:t,selectionStart:n,selectionEnd:i})}},_getLines:function(e,t){return e.substring(0,t).split("\n")},_applyEdits:function(e){var t=this.$refs.textarea,n=this.history.stack[this.history.offset];n&&t&&(this.history.stack[this.history.offset]=i({},n,{selectionStart:t.selectionStart,selectionEnd:t.selectionEnd})),this._recordChange(e),this._updateInput(e)},_recordChange:function(e,t){void 0===t&&(t=!1);var n=this.history,r=n.stack,a=n.offset;if(r.length&&a>-1){this.history.stack=r.slice(0,a+1);var s=this.history.stack.length;if(s>100){var o=s-100;this.history.stack=r.slice(o,s),this.history.offset=Math.max(this.history.offset-o,0)}}var l=Date.now();if(t){var c=this.history.stack[this.history.offset];if(c&&l-c.timestamp<3e3){var u,d,h=/[^a-z0-9]([a-z0-9]+)$/i,p=null===(u=this._getLines(c.value,c.selectionStart).pop())||void 0===u?void 0:u.match(h),g=null===(d=this._getLines(e.value,e.selectionStart).pop())||void 0===d?void 0:d.match(h);if(p&&g&&g[1].startsWith(p[1]))return void(this.history.stack[this.history.offset]=i({},e,{timestamp:l}))}}this.history.stack.push(i({},e,{timestamp:l})),this.history.offset++},_updateInput:function(e){var t=this.$refs.textarea;t&&(t.value=e.value,t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd,this.$emit("input",e.value))},handleChange:function(e){var t=e.target,n=t.value,i=t.selectionStart,r=t.selectionEnd;this._recordChange({value:n,selectionStart:i,selectionEnd:r},!0),this.$emit("input",n)},_undoEdit:function(){var e=this.history,t=e.stack,n=e.offset,i=t[n-1];i&&(this._updateInput(i),this.history.offset=Math.max(n-1,0))},_redoEdit:function(){var e=this.history,t=e.stack,n=e.offset,i=t[n+1];i&&(this._updateInput(i),this.history.offset=Math.min(n+1,t.length-1))},handleKeyDown:function(e){var t=this.tabSize,n=this.insertSpaces,i=this.ignoreTabKey;if(!this.$listeners.keydown||(this.$emit("keydown",e),!e.defaultPrevented)){27===e.keyCode&&(e.target.blur(),this.$emit("blur",e));var r=e.target,o=r.value,l=r.selectionStart,c=r.selectionEnd,u=(n?" ":"\t").repeat(t);if(9===e.keyCode&&!i&&this.capture)if(e.preventDefault(),e.shiftKey){var d=this._getLines(o,l),h=d.length-1,p=this._getLines(o,c).length-1,g=o.split("\n").map(function(e,t){return t>=h&&t<=p&&e.startsWith(u)?e.substring(u.length):e}).join("\n");if(o!==g){var f=d[h];this._applyEdits({value:g,selectionStart:f.startsWith(u)?l-u.length:l,selectionEnd:c-(o.length-g.length)})}}else if(l!==c){var m=this._getLines(o,l),v=m.length-1,y=this._getLines(o,c).length-1,b=m[v];this._applyEdits({value:o.split("\n").map(function(e,t){return t>=v&&t<=y?u+e:e}).join("\n"),selectionStart:/\S/.test(b)?l+u.length:l,selectionEnd:c+u.length*(y-v+1)})}else{var k=l+u.length;this._applyEdits({value:o.substring(0,l)+u+o.substring(c),selectionStart:k,selectionEnd:k})}else if(8===e.keyCode){var x=l!==c,w=o.substring(0,l);if(w.endsWith(u)&&!x){e.preventDefault();var _=l-u.length;this._applyEdits({value:o.substring(0,l-u.length)+o.substring(c),selectionStart:_,selectionEnd:_})}}else if(13===e.keyCode){if(l===c){var F=this._getLines(o,l).pop(),$=null===F||void 0===F?void 0:F.match(/^\s+/);if($&&$[0]){e.preventDefault();var A="\n"+$[0],S=l+A.length;this._applyEdits({value:o.substring(0,l)+A+o.substring(c),selectionStart:S,selectionEnd:S})}}}else if(57===e.keyCode||219===e.keyCode||222===e.keyCode||192===e.keyCode){var C;57===e.keyCode&&e.shiftKey?C=["(",")"]:219===e.keyCode?C=e.shiftKey?["{","}"]:["[","]"]:222===e.keyCode?C=e.shiftKey?['"','"']:["'","'"]:192!==e.keyCode||e.shiftKey||(C=["`","`"]),l!==c&&C&&(e.preventDefault(),this._applyEdits({value:o.substring(0,l)+C[0]+o.substring(l,c)+C[1]+o.substring(c),selectionStart:l,selectionEnd:c+2}))}else(s?e.metaKey&&90===e.keyCode:e.ctrlKey&&90===e.keyCode)&&!e.shiftKey&&!e.altKey?(e.preventDefault(),this._undoEdit()):(s?e.metaKey&&90===e.keyCode&&e.shiftKey:a?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&90===e.keyCode&&e.shiftKey)&&!e.altKey?(e.preventDefault(),this._redoEdit()):77!==e.keyCode||!e.ctrlKey||s&&!e.shiftKey||(e.preventDefault(),this.capture=!this.capture)}}},render:function(e){var t=this,n=e("div",{attrs:{class:"prism-editor__line-width-calc",style:"height: 0px; visibility: hidden; pointer-events: none;"}},"999"),i=e("div",{staticClass:"prism-editor__line-numbers",style:{"min-height":this.lineNumbersHeight},attrs:{"aria-hidden":"true"}},[n,Array.from(Array(this.lineNumbersCount).keys()).map(function(t,n){return e("div",{attrs:{class:"prism-editor__line-number token comment"}},""+ ++n)})]),r=e("textarea",{ref:"textarea",on:{input:this.handleChange,keydown:this.handleKeyDown,click:function(e){t.$emit("click",e)},keyup:function(e){t.$emit("keyup",e)},focus:function(e){t.$emit("focus",e)},blur:function(e){t.$emit("blur",e)}},staticClass:"prism-editor__textarea",class:{"prism-editor__textarea--empty":this.isEmpty},attrs:{spellCheck:"false",autocapitalize:"off",autocomplete:"off",autocorrect:"off","data-gramm":"false",placeholder:this.placeholder,"data-testid":"textarea",readonly:this.readonly},domProps:{value:this.codeData}}),a=e("pre",{ref:"pre",staticClass:"prism-editor__editor",attrs:{"data-testid":"preview"},domProps:{innerHTML:this.content}}),s=e("div",{staticClass:"prism-editor__container"},[r,a]);return e("div",{staticClass:"prism-editor-wrapper"},[this.lineNumbers&&i,s])}})},856:function(e,t,n){var i=n(659);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);n(74)("45038743",i,!0,{})}});