Fix:[#988,#987,#986,#985,#983]修复测试反馈的问题和调整内容

This commit is contained in:
lifizer
2024-03-22 11:51:18 +08:00
parent 0febe3a5a4
commit 18aeb9bdfd
12 changed files with 536 additions and 282 deletions
+30 -4
View File
@@ -1,17 +1,18 @@
<template>
<view class="container" :style="{height: height}">
<editor
ref="editot"
id="editor"
class="ql-container"
:placeholder="placeholder"
:show-img-size="true"
:show-img-toolbar="true"
:show-img-resize="true"
:read-only="readOnly"
@ready="onEditorReady"
id="editor"
@statuschange="statuschange"
@focus="editFocus"
@blur="editBlur"
ref="editot"
></editor>
<!-- 操作工具 -->
<view class="tool-view" >
@@ -36,7 +37,7 @@
</view>
</view>
<view class="tool">
<!-- <jinIcon class="single" type="&#xe6f3;" title="图片" @click="insertImage"></jinIcon> -->
<jinIcon class="single" type="&#xe6f3;" title="图片" @click="insertImage"></jinIcon>
<jinIcon class="single" type="&#xe6f9;" title="格式" @click="showMore" :color="showMoreTool ? activeColor : '#666666'"></jinIcon>
<jinIcon class="single" type="&#xe6eb;" title="分割线" @click="insertDivider"></jinIcon>
<jinIcon class="single" type="&#xe6e8;" title="撤回" @click="undo"></jinIcon>
@@ -49,8 +50,15 @@
<script>
import jinIcon from './jin-icons.vue';
import {
chooseImage
} from '@/utils'
export default {
props: {
readOnly: {
type: Boolean,
default: false
},
// 点击图片时显示图片大小控件
showImgSize: {
type: Boolean,
@@ -127,14 +135,32 @@ export default {
},res => {
this.editorCtx = res.context;
this.editorCtx.setContents({
html: this.html
html: this.html,
success: () => {
this.editorCtx.blur()
}
})
setTimeout(() => {
uni.pageScrollTo({
scrollTop: 0,
duration: 0
})
}, 500)
})
.exec();
},
undo() {
this.editorCtx.undo();
},
insertImage() {
const _this = this
chooseImage((path) => {
_this.editorCtx.insertImage({
src: path,
alt: '图片'
})
})
},
/// 插入分割线
insertDivider() {
this.editorCtx.insertDivider();