我目前正試圖模仿enyo.Popup
的行爲。我看着source在github
,但很難理解它。如何模仿enyo.Popup行爲
特別是我有麻煩的代碼:
handlers: {
//...
onRequestShow: "requestShow",
onRequestHide: "requestHide"
},
//* @public
events: {
//* Fires after the popup is shown.
onShow: "",
//* Fires after the popup is hidden.
onHide: ""
},
還有一些別的地方的代碼,也有對this.show()
電話。
首先,我沒有找到this.show()
的聲明。其次,雖然我認爲它必須分別位於this.show()
和this.hide()
之內,onShow
和onHide
事件的名稱分別在哪裏?
最後,我定義了一種我自己,也包含上面的代碼。但儘管show()
和hide()
方法正在運行,我自己的requestShow()
和requestHide()
方法未被調用。
我錯過了什麼?