如果按下菜单中的按钮,如何关闭打开的FAB菜单?
这是我的按钮.
<ion-fab bottom center > <button ion-fab><b>Hello</b></button> <ion-fab-list side="top"> <button ion-fab (click)="refresh()"><ion-icon name="refresh"></ion-icon></button>
只需将#fab添加到ion-fab标签:
原文链接:https://www.f2er.com/angularjs/140376.html<ion-fab bottom center #fab> <button ion-fab (click)="refresh(fab)"> <ion-icon name="refresh"></ion-icon> </button> </ion-fab>
并使用FabContainer方法close()关闭FAB按钮调用的任何函数开头的FAB菜单(如果打开),例如:
import { FabContainer } from 'ionic-angular'; // remember to pass the fab from client side refresh(fab?: FabContainer):void { if (fab !== undefined) { fab.close(); } (other function stuff...) }