提交 9135aa4e authored 作者: wangjiahao's avatar wangjiahao

fix: 修复富文本表格、图片等拖拽焦点编辑时错位问题

上级 e176d364
...@@ -9,13 +9,7 @@ ...@@ -9,13 +9,7 @@
:disabled="!canEdit" :disabled="!canEdit"
@onClick="onClick" @onClick="onClick"
/> />
<!-- <div v-show="!canEdit" style="width: 100%;height: 100%" @dblclick="setEdit" v-html="myValue" />-->
</div> </div>
<!-- <div v-else class="rich-main-class">-->
<!-- <Editor :id="tinymceId"/>-->
<!-- <div v-html="myValue" />-->
<!-- </div>-->
</template> </template>
<script> <script>
...@@ -101,10 +95,10 @@ export default { ...@@ -101,10 +95,10 @@ export default {
editShow: true, editShow: true,
canEdit: false, canEdit: false,
// 初始化配置 // 初始化配置
tinymceId: 'tinymce', tinymceId: 'tinymce-' + this.element.id,
myValue: this.propValue, myValue: this.propValue,
init: { init: {
selector: '#tinymce', selector: '#tinymce-' + this.element.id,
toolbar_items_size: 'small', toolbar_items_size: 'small',
language_url: '/tinymce/langs/zh_CN.js', // 汉化路径是自定义的,一般放在public或static里面 language_url: '/tinymce/langs/zh_CN.js', // 汉化路径是自定义的,一般放在public或static里面
language: 'zh_CN', language: 'zh_CN',
...@@ -138,11 +132,8 @@ export default { ...@@ -138,11 +132,8 @@ export default {
// 监听内容变化 // 监听内容变化
active(val) { active(val) {
if (!val) { if (!val) {
this.editShow = false
this.canEdit = false this.canEdit = false
this.$nextTick(() => { this.reShow()
this.editShow = true
})
} }
}, },
// 监听内容变化 // 监听内容变化
...@@ -165,7 +156,14 @@ export default { ...@@ -165,7 +156,14 @@ export default {
if (this.editStatus) { if (this.editStatus) {
this.canEdit = true this.canEdit = true
this.element.editing = true this.element.editing = true
this.reShow()
} }
},
reShow() {
this.editShow = false
this.$nextTick(() => {
this.editShow = true
})
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论