diff --git a/pages/API/dialog-page/dialog-page.uvue b/pages/API/dialog-page/dialog-page.uvue index b77b2032887f07abc2bafaacd9c0284a81cde3d1..2dc04c626963215032d1ed82e58f661f211784bd 100644 --- a/pages/API/dialog-page/dialog-page.uvue +++ b/pages/API/dialog-page/dialog-page.uvue @@ -203,9 +203,8 @@ uni.closeDialogPage({}); }, setPageStyleForTest(style : UTSJSONObject) { - const pages = getDialogPages(); - const currentPage = pages[pages.length - 1]; - currentPage.setPageStyle(style); + const pages = this.$page.getDialogPages(); + if (pages.length > 0) pages[pages.length - 1].setPageStyle(style); } } }