mirror of
https://gitee.com/openharmony/applications_launcher
synced 2024-11-23 06:50:02 +00:00
修复长按桌面空白页menu内容在预定条件下不改变的问题
Signed-off-by: zhangchao <zhangchao338@huawei.com>
This commit is contained in:
parent
9a6c68688a
commit
5985514a7c
@ -24,6 +24,7 @@ const TAG = 'AppMenu';
|
||||
@Component
|
||||
export default struct AppMenu {
|
||||
menuInfoList: Array<MenuInfo> = new Array<MenuInfo>();
|
||||
getMenuInfoList: Function;
|
||||
menuMode: number = CommonConstants.MENU_UI_MODE_LIGHT;
|
||||
fixedMenuList: Array<MenuInfo> = null;
|
||||
dynamicMenuList: Array<MenuInfo> = null;
|
||||
@ -31,6 +32,9 @@ export default struct AppMenu {
|
||||
|
||||
aboutToAppear() {
|
||||
Log.showInfo(TAG, 'aboutToAppear start');
|
||||
if (this.getMenuInfoList) {
|
||||
this.menuInfoList = this.getMenuInfoList();
|
||||
}
|
||||
this.fixedMenuList = new Array<MenuInfo>();
|
||||
this.dynamicMenuList = new Array<MenuInfo>();
|
||||
for (let menuInfo of this.menuInfoList) {
|
||||
|
@ -109,7 +109,7 @@ export default struct PageDesktopLayout {
|
||||
return true;
|
||||
}
|
||||
|
||||
private getMenu() {
|
||||
private getMenu(): MenuInfo[] {
|
||||
let menuInfoList = new Array<MenuInfo>();
|
||||
let setting = new MenuInfo();
|
||||
setting.menuType = CommonConstants.MENU_TYPE_FIXED
|
||||
@ -141,7 +141,7 @@ export default struct PageDesktopLayout {
|
||||
if (this.logId()) {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
menuInfoList: this.getMenu()
|
||||
getMenuInfoList: this.getMenu
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
|
Loading…
Reference in New Issue
Block a user