Skip to content

Commit cead91e

Browse files
committed
fix: fix print showcase code
1 parent d8fd92f commit cead91e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

showcase/sheets/print/code/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ const { univerAPI } = createUniver({
3333

3434
univerAPI.createWorkbook(WORKBOOK_DATA)
3535

36-
univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, ({ stage }) => {
37-
if (stage === univerAPI.Enum.LifecycleStages.Rendered) {
36+
univerAPI.addEvent(univerAPI.Event.CellClicked, (params) => {
37+
const { worksheet, row, column } = params
38+
if (worksheet.getRange(row, column).getA1Notation() === 'A7') {
3839
const fWorkbook = univerAPI.getActiveWorkbook()
3940
fWorkbook?.openPrintDialog()
4041
}

0 commit comments

Comments
 (0)