|
|
|
@ -2,8 +2,10 @@
|
|
|
|
<div class="tinymce">
|
|
|
|
<div class="tinymce">
|
|
|
|
<Editor v-model="myValue" :init="init" :disabled="disabled"></Editor>
|
|
|
|
<Editor v-model="myValue" :init="init" :disabled="disabled"></Editor>
|
|
|
|
<EditorImage
|
|
|
|
<EditorImage
|
|
|
|
|
|
|
|
:show="showImg"
|
|
|
|
class="tinymce__upload"
|
|
|
|
class="tinymce__upload"
|
|
|
|
@successCBK="imageSuccessCBK"
|
|
|
|
@successCBK="imageSuccessCBK"
|
|
|
|
|
|
|
|
@updateshow="updateshow"
|
|
|
|
></EditorImage>
|
|
|
|
></EditorImage>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -54,18 +56,19 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
toolbar: {
|
|
|
|
toolbar: {
|
|
|
|
type: [String, Array],
|
|
|
|
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 |
|
|
|
|
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`,
|
|
|
|
insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
menubar: {
|
|
|
|
menubar: {
|
|
|
|
type: String,
|
|
|
|
type: String,
|
|
|
|
default: "edit insert view format table",
|
|
|
|
default: "edit insert view format table CardBtn",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
myValue: this.value,
|
|
|
|
myValue: this.value,
|
|
|
|
|
|
|
|
showImg:false,
|
|
|
|
init: {
|
|
|
|
init: {
|
|
|
|
language_url: "@/asset/tinymce/langs/zh_CN.js", // 这里需要单独处理
|
|
|
|
language_url: "@/asset/tinymce/langs/zh_CN.js", // 这里需要单独处理
|
|
|
|
language: "zh_CN",
|
|
|
|
language: "zh_CN",
|
|
|
|
@ -75,6 +78,18 @@ export default {
|
|
|
|
toolbar: this.toolbar,
|
|
|
|
toolbar: this.toolbar,
|
|
|
|
branding: false,
|
|
|
|
branding: false,
|
|
|
|
menubar: this.menubar,
|
|
|
|
menubar: this.menubar,
|
|
|
|
|
|
|
|
setup: (editor) => {
|
|
|
|
|
|
|
|
let _this = this
|
|
|
|
|
|
|
|
//定义一个名为 assignment 的toolbar
|
|
|
|
|
|
|
|
editor.ui.registry.addButton('assignment', {
|
|
|
|
|
|
|
|
text: `<i class="el-icon-position" style="font-size: 16px">上传</i>`,
|
|
|
|
|
|
|
|
tooltip: '图片上传',
|
|
|
|
|
|
|
|
onAction: () => {
|
|
|
|
|
|
|
|
this.showImg = true
|
|
|
|
|
|
|
|
// _this.showEdit = true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
//此处为图片上传处理函数,这个直接用了base64的图片形式上传图片,
|
|
|
|
//此处为图片上传处理函数,这个直接用了base64的图片形式上传图片,
|
|
|
|
//如需ajax上传可参考https://www.tiny.cloud/docs/configure/file-image-upload/#images_upload_handler
|
|
|
|
//如需ajax上传可参考https://www.tiny.cloud/docs/configure/file-image-upload/#images_upload_handler
|
|
|
|
// images_upload_handler: (blobInfo, success, failure) => {
|
|
|
|
// images_upload_handler: (blobInfo, success, failure) => {
|
|
|
|
@ -85,6 +100,9 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
updateshow(val){
|
|
|
|
|
|
|
|
this.showImg = val
|
|
|
|
|
|
|
|
},
|
|
|
|
imageSuccessCBK(arr) {
|
|
|
|
imageSuccessCBK(arr) {
|
|
|
|
arr.forEach(
|
|
|
|
arr.forEach(
|
|
|
|
(v) => (this.myValue += `<img class="wscnph" src="${v.url}" >`)
|
|
|
|
(v) => (this.myValue += `<img class="wscnph" src="${v.url}" >`)
|
|
|
|
@ -115,5 +133,8 @@ export default {
|
|
|
|
right: 4px;
|
|
|
|
right: 4px;
|
|
|
|
top: 0px;
|
|
|
|
top: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
::v-deep .tox.tox-tinymce.tox-fullscreen{
|
|
|
|
|
|
|
|
z-index:0
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|