2015-10-07 92 views

回答

1

沒有具體dismiss事件paper-dialog,因爲它繼承了鐵覆蓋的行爲。但是,您可以創建自定義事件來觸發對話框關閉:

// Fire a custom event 
this.fire('custom-dialog-dismiss'); 

// Listen to the event on an element OR add a listener 
<my-element on-custom-dialog-dismiss="_handleDismiss"></my-element> 
...or... 
listeners: { 
    'custom-dialog-dismiss': '_handleDismiss' 
} 

// Then handle the action 
_handleDismiss: function(e) { 
    this.$.myDialog.close(); 
}