|
|
@@ -40,9 +40,15 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 父组件 ref 调用的初始化入口(对齐老 Quill 实现的 init() 行为)
|
|
|
+ // 不能再销毁重建:父组件 add.vue / detail.vue 会在 mounted 或切 tab 时通过
|
|
|
+ // setTimeout 调用 init(),销毁旧的 wangEditor/Slate 实例会导致:
|
|
|
+ // 1) 已渲染的工具栏 DOM 还指向被 revoke 的 slate proxy → 按钮 click 无响应
|
|
|
+ // 2) 新建的 editor 工具栏被旧 DOM 遮挡,视觉上像"不可点击"
|
|
|
+ // mounted 已经完成创建,这里只做幂等占位;内容回填由 watch content → setHtml 处理
|
|
|
init() {
|
|
|
- this._destroyEditor()
|
|
|
- this._createEditor()
|
|
|
+ if (!this.editor) {
|
|
|
+ this._createEditor()
|
|
|
+ }
|
|
|
},
|
|
|
_destroyEditor() {
|
|
|
if (this.editor) {
|