fix: contentChange call error during initialization #224

This commit is contained in:
Hufe921
2023-07-28 19:22:01 +08:00
parent 73014dc87b
commit 1b25afb664
3 changed files with 12 additions and 5 deletions
+7 -3
View File
@@ -222,7 +222,10 @@ export class Draw {
this.intersectionPageNo = 0
this.lazyRenderIntersectionObserver = null
this.render({ isSetCursor: false })
this.render({
isInit: true,
isSetCursor: false
})
}
public getMode(): EditorMode {
@@ -1708,7 +1711,8 @@ export class Draw {
isSubmitHistory = true,
isSetCursor = true,
isCompute = true,
isLazy = true
isLazy = true,
isInit = false
} = payload || {}
let { curIndex } = payload || {}
const innerWidth = this.getInnerWidth()
@@ -1823,7 +1827,7 @@ export class Draw {
this.eventBus.emit('pageSizeChange', this.pageRowList.length)
}
// 文档内容改变
if (isSubmitHistory) {
if (isSubmitHistory && !isInit) {
if (this.listener.contentChange) {
this.listener.contentChange()
}
+1
View File
@@ -8,6 +8,7 @@ export interface IDrawOption {
isSubmitHistory?: boolean
isCompute?: boolean
isLazy?: boolean
isInit?: boolean
}
export interface IDrawImagePayload {