update 更新目录

This commit is contained in:
赵霄
2024-04-21 20:01:17 +08:00
parent b849acc26e
commit 0b1698aaf2
+1 -1
View File
@@ -1655,6 +1655,7 @@ export default {
let that = this let that = this
that.ctx.callCommand(() => { that.ctx.callCommand(() => {
try { try {
Api.asc_UpdateTableOfContents()
const oDocument = Api.GetDocument() const oDocument = Api.GetDocument()
const tables = oDocument.GetAllTables() const tables = oDocument.GetAllTables()
if (tables && tables.length > 0) { if (tables && tables.length > 0) {
@@ -1723,7 +1724,6 @@ export default {
} }
} }
} }
Api.asc_UpdateTableOfContents()
for (let index = 0; index < allElement; index++) { for (let index = 0; index < allElement; index++) {
const element = oDocument.GetElement(index) const element = oDocument.GetElement(index)
if ('blockLvlSdt' === element.GetClassType()) { if ('blockLvlSdt' === element.GetClassType()) {