未验证 提交 57fdba92 编写于 作者: O openharmony_ci 提交者: Gitee

!21775 【OpenHarmony-4.0-Beta2】去除showSideBar

Merge pull request !21775 from songqq0825/OpenHarmony-4.0-Beta2
...@@ -354,16 +354,10 @@ struct MultiLaneList { ...@@ -354,16 +354,10 @@ struct MultiLaneList {
struct SideBarSample { struct SideBarSample {
@StorageLink('currentBreakpoint') private currentBreakpoint: string = "md"; @StorageLink('currentBreakpoint') private currentBreakpoint: string = "md";
private breakpointSystem: BreakpointSystem = new BreakpointSystem() private breakpointSystem: BreakpointSystem = new BreakpointSystem()
@State showSideBar: boolean = false
@State selectIndex: number = 0; @State selectIndex: number = 0;
aboutToAppear() { aboutToAppear() {
this.breakpointSystem.register() this.breakpointSystem.register()
if (this.currentBreakpoint === 'sm') {
this.showSideBar = false
} else {
this.showSideBar = true
}
} }
aboutToDisappear() { aboutToDisappear() {
...@@ -382,9 +376,6 @@ struct SideBarSample { ...@@ -382,9 +376,6 @@ struct SideBarSample {
.height(36) .height(36)
.onClick(() => { .onClick(() => {
this.selectIndex = index this.selectIndex = index
if (this.currentBreakpoint === 'sm') {
this.showSideBar = false
}
}) })
} }
...@@ -412,9 +403,8 @@ struct SideBarSample { ...@@ -412,9 +403,8 @@ struct SideBarSample {
.maxSideBarWidth(this.currentBreakpoint === 'sm' ? '100%' : '33.33%') .maxSideBarWidth(this.currentBreakpoint === 'sm' ? '100%' : '33.33%')
.showControlButton(this.currentBreakpoint === 'sm') .showControlButton(this.currentBreakpoint === 'sm')
.autoHide(false) .autoHide(false)
.showSideBar(this.showSideBar)
.onChange((isBarShow: boolean) => { .onChange((isBarShow: boolean) => {
this.showSideBar = isBarShow
}) })
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册