vue使用kindeditor插件第二次打开无法输入

<kindeditor id="editor_id" height="500px" width="700px"  :loadStyleMode="false" :wellFormatMode="true" :filterMode="false"
                      :content="editorText"></kindeditor>

element+vue前端项目,整个富文本编辑器放在dialog中,第一打开dialog能够正常获取数据,也能编辑输入,关闭后第二次打开的时候输入框就无法输入,点击工具栏加粗、斜体等按钮控制台就报错
Cannot read property 'scrollX' of null

阅读 2.6k
2 个回答

关闭dialog 是不是销毁了内容?

暂时解决了
原因:kindeditor没法获取到焦点
解决方法:在dialog上增加v-if="open"
这个open绑定的数据和:visible.sync="open"一样

<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body @closed="closeDialog"
               :close-on-click-modal="false" v-if="open">
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题