Commit 39607c95 authored by wangxl's avatar wangxl

44

parent af7d2197
......@@ -23,7 +23,7 @@ export default {
id: {
type: String,
default: function () {
return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
return 'vue-tinymce-' + new Date() + ((Math.random() * 1000).toFixed(0) + '')
}
},
value: {
......@@ -34,6 +34,7 @@ export default {
},
},
created () {
console.log(window.tinymce.get(this.id), 'created', this.id)
},
methods: {
initTinymce () {
......@@ -51,7 +52,7 @@ export default {
statusbar: false,
height: 600,
plugins: 'code advlist autolink link image lists preview table wordcount',
toolbar: `undo redo | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | image | wordcount`,
toolbar: `undo redo | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | image | wordcount`,
//| styleselect | fontsizeselect fontselect | table tabledelete | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol
// 初始化完成回调
init_instance_callback: (editor) => {
......@@ -115,6 +116,7 @@ export default {
},
watch: {
value (val) {
console.log(window.tinymce.get(this.id), 'watch', this.id)
if (!!val && !this.hasChange) {
this.$nextTick(() => {
this.hasChange = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment