@jecloud/ui
Version:
JECloud UI库,基于ant-design-vue封装
1 lines • 1.54 kB
JavaScript
var t=this&&this.__assign||function(){return t=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},t.apply(this,arguments)},e=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),o=0;for(e=0;e<r;e++)for(var n=arguments[e],s=0,a=n.length;s<a;s++,o++)i[o]=n[s];return i};import{withDirectives as r,createVNode as i,mergeProps as o,resolveDirective as n}from"vue";import{defineComponent as s,watch as a}from"vue";import u from"@tinymce/tinymce-vue";import{useConfig as l}from"./config";import p from"./config/events";import{isEmpty as c,omit as m}from"@jecloud/utils";import{useEditor as f}from"../../editor-code/src/hooks/use-editor";export default s({name:"JeEditorHtml",inheritAttrs:!1,props:{value:{type:String,default:""},width:[String,Number],height:{type:[String,Number],default:400},editorOptions:Object},emits:e(p,["update:value"]),setup:function(e,s){var p=s.slots,v=s.attrs,d=s.expose,g=f({props:e,context:s}),h=g.value,y=g.style,S=g.$plugin,b=l({props:e}),j=b.init,O=b.tinymceScriptSrc,_=b.getEditor,w=b.loading;return a((function(){return h.value}),(function(t){c(t,!0)&&(h.value="")})),d({getEditor:_,$plugin:S}),function(){return r(i("div",{class:"je-editor-html",style:t(t({},y),v.style)},[i(u,o({ref:S,modelValue:h.value,"onUpdate:modelValue":function(t){return h.value=t}},m(v,["style"]),{init:j,tinymceScriptSrc:O}),p)]),[[n("loading"),w.value]])}}});