未验证 提交 2f94a9f0 编写于 作者: S songqq0825 提交者: Gitee

侧边栏代码修改

Signed-off-by: Nsongqq0825 <songqinqin4@huawei.com>
上级 2eae9b9c
......@@ -355,6 +355,7 @@ struct SideBarSample {
@StorageLink('currentBreakpoint') private currentBreakpoint: string = "md";
private breakpointSystem: BreakpointSystem = new BreakpointSystem()
@State selectIndex: number = 0;
@State showSideBar:boolean=false;
aboutToAppear() {
this.breakpointSystem.register()
......@@ -375,7 +376,10 @@ struct SideBarSample {
.width(180)
.height(36)
.onClick(() => {
this.selectIndex = index
this.selectIndex = index;
if(this.currentBreakpoint === 'sm'){
this.showSideBar=false
}
})
}
......@@ -403,8 +407,11 @@ struct SideBarSample {
.maxSideBarWidth(this.currentBreakpoint === 'sm' ? '100%' : '33.33%')
.showControlButton(this.currentBreakpoint === 'sm')
.autoHide(false)
.showSideBar(this.currentBreakpoint !== 'sm'||this.showSideBar)
.onChange((isBarShow: boolean) => {
if(this.currentBreakpoint === 'sm'){
this.showSideBar=isBarShow
}
})
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册