text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["front-text"],{"165f":function(t,e,n){},"3f22":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"content",attrs:{"element-loading-text":"拼命加载中"}},["md"!==t.getFileSuffix(t.file.name)?n("div",{staticClass:"editor",attrs:{id:"container"}}):t._e(),"md"===t.getFileSuffix(t.file.name)?n("div",{staticClass:"dialog-scroll markdown-body",domProps:{innerHTML:t._s(t.markdownHtml)}}):t._e()])},a=[],o=(n("8dee"),n("5289"),n("a450"),n("2909")),r=n.n(o),l=n("02c6"),d=n.n(l);n("77bb");d.a.registerLanguage("markdown",n("79a6"));var s={name:"TextPreview",components:{},data:function(){return{text:"",loading:!0,editor:""}},props:{file:Object},mounted:function(){var t=this,e=this.file;this.$http.get(e.url,{withCredentials:!1}).then((function(e){t.loading=!1,t.text=e.data,t.initMonaco()})).catch((function(){t.$http.get("common/content",{params:{url:e.url}}).then((function(e){t.loading=!1,t.text=e.data.data,t.initMonaco()}))}))},methods:{getFileSuffix:function(t){var e=t.substr(t.lastIndexOf(".")+1).toLocaleLowerCase();return"js"===e?"javascript":e},initMonaco:function(){var t=this;"md"!==this.getFileSuffix(this.file.name)&&n.e("monaco-editor").then(n.t.bind(null,"d653",7)).then((function(e){var n=e.editor;n.create(document.getElementById("container"),{value:t.text,language:t.getFileSuffix(t.file.name),theme:"vs"})}))}},computed:{markdownHtml:function(){var t=new r.a.Renderer;return t.link=function(){var t=r.a.Renderer.prototype.link.apply(this,arguments);return t.replace("<a","<a target='_blank'")},r.a.setOptions({renderer:t}),r()(this.text,{highlight:function(t){return d.a.highlightAuto(t).value}})}}},c=s,u=(n("4f25"),n("5d22")),f=Object(u["a"])(c,i,a,!1,null,"4d8ebd0e",null);e["default"]=f.exports},"4f25":function(t,e,n){"use strict";n("165f")}}]);