Ionic2 弹出窗口的离子2背景仍然可以单击

Ionic2 弹出窗口的离子2背景仍然可以单击,ionic2,Ionic2,当我在页面上显示警报时,用户可以单击背景并解除警报。有没有办法使背景不可点击 this.alert = this.alertController.create({ title: 'Error', subTitle: "You lost connection !", buttons: [ {

当我在页面上显示警报时,用户可以单击背景并解除警报。有没有办法使背景不可点击

this.alert = this.alertController.create({
                                title: 'Error',
                                subTitle: "You lost connection !",
                                buttons: [ {
                                text: 'Refresh',
                                handler: () => {
                                    if(!data){
                                    this.alert.dismiss().then(() => {
                                        this.alert = null;
                                 });
                                    }
                        }
                    }]
                });

创建警报时,只需将EnableBackDropDisclose选项设置为false。例如:

this.alert = this.alertController.create({
                                title: 'Error',
                                subTitle: "You lost connection !",
                                enableBackdropDismiss: false,
                                buttons: [ {
                                text: 'Refresh',
                                handler: () => {
                                    if(!data){
                                    this.alert.dismiss().then(() => {
                                        this.alert = null;
                                 });
                                    }
                        }
                    }]
                });
希望这对你有帮助。谢谢