基本上我試着做一個端口GoldCcCvcInput
飛鏢執行,而不是包裝的js實現。在dart中如何使用PaperInputBehavior擴展自定義PolymerElement?
看着這樣的: https://github.com/PolymerElements/gold-cc-cvc-input/blob/master/gold-cc-cvc-input.html 加上https://github.com/dart-lang/polymer-dart/wiki/behaviors
喜歡的東西:
@PolymerRegister('nbdate-input')
class NbdateInput extends PolymerElement with PaperInputBehavior,
IronControlState, IronA11yKeysBehavior ...
最少的測試項目 https://github.com/jonboj/inputbehavior-dart.git
項目初始化沒有傾銷任何錯誤消息,並顯示鐵輸入元素確定。但是,當該鐵輸入元件中的一個被放置在焦點,該異常下面被傾倒在控制檯:
Uncaught TypeError: Cannot read property 'focus' of undefined
Polymer.PaperInputBehaviorImpl._onFocus
handler
Polymer.Base._addFeature.fire
Polymer.IronControlState._focusBlurHandler
這具有方法onFocusedChanged
https://github.com/PolymerElements/gold-cc-cvc-input/blob/master/gold-cc-cvc-input.html#L219
在鏢相應觀察被觸發的替代時,在異常轉儲後發生打印輸出。
https://github.com/jonboj/inputbehavior-dart/blob/master/lib/nbdatebehavior_input.dart#L56
感謝您的反饋結構如下提供。現在我已經用更多信息和示例回購編輯了這個問題。檢查*)訂單'IronA11yKeysBehavior,IronControlState,PaperInputBehavior'它在初始化時在控制檯中轉儲一個異常,並且按照mixin的順序。 *)根據api'polymerCreated()'調用將在'NbdatebehaviorInput.created():super.created()' –
調用我已經進一步研究了這一點。也許所需的功能可以通過將一些東西放在一個''中來獲得,也許這個框架也是可以實現的。我會進一步調查。 –