From 22cbb07ccd65f198e2ccb2fc88db95067a13d54b Mon Sep 17 00:00:00 2001 From: elinehyl <14728363+elinehyl@user.noreply.gitee.com> Date: Fri, 13 Jun 2025 07:36:19 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BA=9F=E5=BC=83=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: elinehyl <14728363+elinehyl@user.noreply.gitee.com> --- entry/src/main/ets/view/ListPage.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entry/src/main/ets/view/ListPage.ets b/entry/src/main/ets/view/ListPage.ets index 9881bd8..c964424 100644 --- a/entry/src/main/ets/view/ListPage.ets +++ b/entry/src/main/ets/view/ListPage.ets @@ -25,7 +25,7 @@ export default struct ListPage { @State newsModel: ListModel = new ListModel(); @Watch('getInitData') @LocalStorageLink('List') List: ResData[] = []; @LocalStorageLink('Fail') isFail: boolean = false; - context = getContext(); + context = this.getUIContext()?.getHostContext() as Context; getInitData() { this.newsModel.currentPage = 1; -- Gitee From 6a51a5392c51afa546113a85713b7a063f2089dc Mon Sep 17 00:00:00 2001 From: elinehyl <14728363+elinehyl@user.noreply.gitee.com> Date: Fri, 13 Jun 2025 07:37:05 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BA=9F=E5=BC=83=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: elinehyl <14728363+elinehyl@user.noreply.gitee.com> --- entry/src/main/ets/pages/Index.ets | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index ea872e9..cf6b8c7 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -16,9 +16,7 @@ import { FULL_HEIGHT, FULL_WIDTH } from '../common/constant/CommonConstants'; import TabBar from '../view/TabBar'; -let storage = LocalStorage.getShared(); - -@Entry(storage) +@Entry({ useSharedStorage: true }) @Component struct Index { build() { -- Gitee