UNPKG

jodit-vue

Version:
2 lines (1 loc) 2.27 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jodit")):"function"==typeof define&&define.amd?define(["exports","jodit"],e):e((t=t||self).JoditVue={},t.Jodit)}(this,(function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=function(t,e,n,o,i,r,s,u,d,a){"boolean"!=typeof s&&(d=u,u=s,s=!1);var f,l="function"==typeof n?n.options:n;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),o&&(l._scopeId=o),r?(f=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,d(t)),t&&t._registeredComponents&&t._registeredComponents.add(r)},l._ssrRegister=f):e&&(f=s?function(){e.call(this,a(this.$root.$options.shadowRoot))}:function(t){e.call(this,u(t))}),f)if(l.functional){var c=l.render;l.render=function(t,e){return f.call(e),c(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,f):[f]}return n},o={name:"JoditVue",props:{value:{type:String,required:!0},buttons:{type:Array,default:null},extraButtons:{type:Array,default:null},config:{type:Object,default:function(){return{}}}},data:function(){return{editor:null}},computed:{editorConfig:function(){var t=Object.assign({},this.config);return this.buttons&&(t.buttons=this.buttons,t.buttonsMD=this.buttons,t.buttonsSM=this.buttons,t.buttonsXS=this.buttons),this.extraButtons&&(t.extraButtons=this.extraButtons),t}},watch:{value:function(t){this.editor.value!==t&&(this.editor.value=t)}},mounted:function(){var t=this;this.editor=new e(this.$el,this.editorConfig),this.editor.value=this.value,this.editor.events.on("change",(function(e){return t.$emit("input",e)}))},beforeDestroy:function(){this.editor.destruct()}},i=function(){var t=this.$createElement;return(this._self._c||t)("div")};i._withStripped=!0;var r=n({render:i,staticRenderFns:[]},void 0,o,void 0,!1,void 0,void 0,void 0);function s(t){s.installed||(s.installed=!0,t.component("JoditVue",r))}var u={install:s},d=null;"undefined"!=typeof window?d=window.Vue:"undefined"!=typeof global&&(d=global.Vue),d&&d.use(u),t.Jodit=e,t.default=r,t.install=s,Object.defineProperty(t,"__esModule",{value:!0})}));