refactor(富文本): 富文本组件和富文本视图

This commit is contained in:
wangjiahao 2022-10-27 16:31:40 +08:00
parent b72c2681dc
commit 9cfb88fa40
3 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,9 @@
<template>
<div class="rich-main-class" :style="autoStyle" @dblclick="setEdit">
<div
class="rich-main-class"
:style="autoStyle"
@dblclick="setEdit"
>
<Editor
v-if="editShow"
:id="tinymceId"
@ -97,7 +101,7 @@ export default {
}
},
computed: {
scale(){
scale() {
return Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient
},
editStatus() {
@ -107,7 +111,7 @@ export default {
return {
height: (100 / this.scale) + '%!important',
width: (100 / this.scale) + '%!important',
left: 50 * (1 - 1 / this.scale) + '%', // 2
left: 50 * (1 - 1 / this.scale) + '%', // 2
top: 50 * (1 - 1 / this.scale) + '%',
transform: 'scale(' + this.scale + ')'
}

View File

@ -1,5 +1,9 @@
<template>
<div class="rich-main-class" :style="autoStyle" @dblclick="setEdit">
<div
class="rich-main-class"
:style="autoStyle"
@dblclick="setEdit"
>
<Editor
v-if="editShow"
:id="tinymceId"
@ -111,7 +115,7 @@ export default {
return {
height: (100 / this.scale) + '%!important',
width: (100 / this.scale) + '%!important',
left: 50 * (1 - 1 / this.scale) + '%', // 2
left: 50 * (1 - 1 / this.scale) + '%', // 2
top: 50 * (1 - 1 / this.scale) + '%',
transform: 'scale(' + this.scale + ')'
}
@ -181,7 +185,6 @@ export default {
ed.insertContent(attachValue)
},
onClick(e) {
const edInner = tinymce.get(this.tinymceId)
const node = tinymce.activeEditor.selection.getNode()
this.resetSelect(node)
},

View File

@ -127,8 +127,8 @@
</div>
<div class="de-foot">
<deBtn
@click="reset"
secondary
@click="reset"
>{{
$t("commons.reset")
}}</deBtn>