1 line
15 KiB
JSON
1 line
15 KiB
JSON
|
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\Tinymce\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\Tinymce\\index.vue","mtime":1622443089431},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/**\n * docs:\n * https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html#tinymce\n */\nimport editorImage from './components/EditorImage'\nimport plugins from './plugins'\nimport toolbar from './toolbar'\nimport load from './dynamicLoadScript'\n\n// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one\nconst tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'\n\nexport default {\n name: 'Tinymce',\n components: { editorImage },\n props: {\n id: {\n type: String,\n default: function() {\n return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')\n }\n },\n value: {\n type: String,\n default: ''\n },\n toolbar: {\n type: Array,\n required: false,\n default() {\n return []\n }\n },\n menubar: {\n type: String,\n default: 'file edit insert view format table'\n },\n height: {\n type: [Number, String],\n required: false,\n default: 360\n },\n width: {\n type: [Number, String],\n required: false,\n default: 'auto'\n }\n },\n data() {\n return {\n hasChange: false,\n hasInit: false,\n tinymceId: this.id,\n fullscreen: false,\n languageTypeList: {\n 'en': 'en',\n 'zh': 'zh_CN',\n 'es': 'es_MX',\n 'ja': 'ja'\n }\n }\n },\n computed: {\n containerWidth() {\n const width = this.width\n if (/^[\\d]+(\\.[\\d]+)?$/.test(width)) { // matches `100`, `'100'`\n return `${width}px`\n }\n return width\n }\n },\n watch: {\n value(val) {\n if (!this.hasChange && this.hasInit) {\n this.$nextTick(() =>\n window.tinymce.get(this.tinymceId).setContent(val || ''))\n }\n }\n },\n mounted() {\n this.init()\n },\n activated() {\n if (window.tinymce) {\n this.initTinymce()\n }\n },\n deactivated() {\n this.destroyTinymce()\n },\n destroyed() {\n this.destroyTinymce()\n },\n methods: {\n init() {\n // dynamic load tinymce from cdn\n load(tinymceCDN, (err) => {\n if (err) {\n this.$message.error(err.message)\n return\n }\n this.initTinymce()\n })\n },\n initTinymce() {\n const _this = this\n window.tinymce.init({\n selector: `#${this.tinymceId}`,\n language: this.languageTypeList['en'],\n height: this.height,\n body_class: 'panel-body ',\n object_resizing: false,\n toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,\n menubar: this.menubar,\n plugins: plugins,\n end_container_on_empty_block: true,\n powerpaste_word_import: 'clean',\n code_dialog_height: 450,\n code_dialog_width: 1000,\n advlist_bullet_styles: 'square',\n advlist_number_styles: 'default',\n imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],\n default_link_target: '_blank',\n link_title: false,\n nonbreakin
|