Skip to content

Commit b166620

Browse files
committed
feat: UniverSheet add onRendered Lifecycle
1 parent 2c38c0f commit b166620

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • src/components/BootstrapBlazor.UniverSheet/wwwroot

src/components/BootstrapBlazor.UniverSheet/wwwroot/univer.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ export async function createUniverSheetAsync(sheet) {
113113
univerAPI.createWorkbook();
114114
}
115115

116+
const disposable = univerAPI.addEvent(
117+
univerAPI.Event.LifeCycleChanged,
118+
({ stage }) => {
119+
if (stage === univerAPI.Enum.LifecycleStages.Rendered) {
120+
console.log('界面渲染完成')
121+
// 移除loading...
122+
123+
// 移除监听器
124+
disposable.dispose()
125+
}
126+
},
127+
)
128+
116129
sheet.univer = univer;
117130
sheet.univerAPI = univerAPI;
118131
sheet.dispose = () => {

0 commit comments

Comments
 (0)