diff --git a/src/components/XyTinymce/EditorImage.vue b/src/components/XyTinymce/EditorImage.vue index 107852e..9b37205 100644 --- a/src/components/XyTinymce/EditorImage.vue +++ b/src/components/XyTinymce/EditorImage.vue @@ -1,9 +1,9 @@ @@ -54,18 +56,19 @@ export default { }, toolbar: { type: [String, Array], - default: ` undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent | + default: ` undo redo restoredraft | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent | styleselect formatselect fontselect fontsizeselect | table image charmap emoticons hr pagebreak |bullist numlist | blockquote subscript superscript removeformat | insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs`, }, menubar: { type: String, - default: "edit insert view format table", + default: "edit insert view format table CardBtn", }, }, data() { return { myValue: this.value, + showImg:false, init: { language_url: "@/asset/tinymce/langs/zh_CN.js", // 这里需要单独处理 language: "zh_CN", @@ -75,6 +78,18 @@ export default { toolbar: this.toolbar, branding: false, menubar: this.menubar, + setup: (editor) => { + let _this = this + //定义一个名为 assignment 的toolbar + editor.ui.registry.addButton('assignment', { + text: `上传`, + tooltip: '图片上传', + onAction: () => { + this.showImg = true + // _this.showEdit = true + }, + }) + }, //此处为图片上传处理函数,这个直接用了base64的图片形式上传图片, //如需ajax上传可参考https://www.tiny.cloud/docs/configure/file-image-upload/#images_upload_handler // images_upload_handler: (blobInfo, success, failure) => { @@ -85,6 +100,9 @@ export default { }; }, methods: { + updateshow(val){ + this.showImg = val + }, imageSuccessCBK(arr) { arr.forEach( (v) => (this.myValue += ``) @@ -115,5 +133,8 @@ export default { right: 4px; top: 0px; } + ::v-deep .tox.tox-tinymce.tox-fullscreen{ + z-index:0 + } }