当分辨率超过768px时,Ionic 2中的侧面菜单将永久打开。 [英] Side Menu in Ionic 2 to be opened permanently when resolution more than 768px.

查看:144
本文介绍了当分辨率超过768px时,Ionic 2中的侧面菜单将永久打开。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Ionic 2.我在选择菜单项时禁用了侧边菜单的关闭,并在openPage()中注释this.menu.close()。但当我在侧面菜单外点击或点击时,侧面菜单正在关闭。当分辨率超过768px时,我需要打开侧边菜单。

In Ionic 2. I have disabled the closing of side menu while selecting the menu item with commenting this.menu.close() in openPage(). but when I'm clicking or tapping on outside the side menu the side menu is closing. I need the side menu to be opened when resolution is more than 768px.

但是在侧面菜单外点击或点击时会关闭侧边菜单。

But when tapping or clicking outside the side menu closes the side menu.

在Ionic中点击或点击侧边菜单外,如何防止关闭侧边菜单2?

How can I prevent the closing of side menu when tapping or clicking outside the side menu in Ionic 2?

推荐答案

我不确定你能否直截了当地做到这一点。我要做的就是在菜单内容中使用组件包装器,并在< ion-content> 中使用相同的包装器,如果分辨率高于一些价值( * ngIf )。

I am not sure you can do this straightforwardly. What I would do to have this behavior is to use a component wrapper inside the menu content and use this same wrapper inside the <ion-content> if the resolution is higher than some value (with an *ngIf).

你的情况下方便吗?

编辑:我在这个主题

EDIT : I posted an example of what I proposed in this thread.

这篇关于当分辨率超过768px时,Ionic 2中的侧面菜单将永久打开。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆