diff --git a/zh-cn/application-dev/key-features/multi-device-app-dev/typical-layout-scenario.md b/zh-cn/application-dev/key-features/multi-device-app-dev/typical-layout-scenario.md index 78e8fced82673e71ce3a09a726d46a10124a7621..0817e2f588d3b5400ba5684aa5f80566d51a5997 100644 --- a/zh-cn/application-dev/key-features/multi-device-app-dev/typical-layout-scenario.md +++ b/zh-cn/application-dev/key-features/multi-device-app-dev/typical-layout-scenario.md @@ -354,16 +354,10 @@ struct MultiLaneList { struct SideBarSample { @StorageLink('currentBreakpoint') private currentBreakpoint: string = "md"; private breakpointSystem: BreakpointSystem = new BreakpointSystem() - @State showSideBar: boolean = false @State selectIndex: number = 0; aboutToAppear() { - this.breakpointSystem.register() - if (this.currentBreakpoint === 'sm') { - this.showSideBar = false - } else { - this.showSideBar = true - } + this.breakpointSystem.register() } aboutToDisappear() { @@ -382,9 +376,6 @@ struct SideBarSample { .height(36) .onClick(() => { this.selectIndex = index - if (this.currentBreakpoint === 'sm') { - this.showSideBar = false - } }) } @@ -412,9 +403,8 @@ struct SideBarSample { .maxSideBarWidth(this.currentBreakpoint === 'sm' ? '100%' : '33.33%') .showControlButton(this.currentBreakpoint === 'sm') .autoHide(false) - .showSideBar(this.showSideBar) .onChange((isBarShow: boolean) => { - this.showSideBar = isBarShow + }) } }