Commit 39607c95 authored by wangxl's avatar wangxl

44

parent af7d2197
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
id: { id: {
type: String, type: String,
default: function () { default: function () {
return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '') return 'vue-tinymce-' + new Date() + ((Math.random() * 1000).toFixed(0) + '')
} }
}, },
value: { value: {
...@@ -34,6 +34,7 @@ export default { ...@@ -34,6 +34,7 @@ export default {
}, },
}, },
created () { created () {
console.log(window.tinymce.get(this.id), 'created', this.id)
}, },
methods: { methods: {
initTinymce () { initTinymce () {
...@@ -51,7 +52,7 @@ export default { ...@@ -51,7 +52,7 @@ export default {
statusbar: false, statusbar: false,
height: 600, height: 600,
plugins: 'code advlist autolink link image lists preview table wordcount', 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 //| styleselect | fontsizeselect fontselect | table tabledelete | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol
// 初始化完成回调 // 初始化完成回调
init_instance_callback: (editor) => { init_instance_callback: (editor) => {
...@@ -115,6 +116,7 @@ export default { ...@@ -115,6 +116,7 @@ export default {
}, },
watch: { watch: {
value (val) { value (val) {
console.log(window.tinymce.get(this.id), 'watch', this.id)
if (!!val && !this.hasChange) { if (!!val && !this.hasChange) {
this.$nextTick(() => { this.$nextTick(() => {
this.hasChange = true 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