我有一个自定义组件,我想将用户交互操作附加到:
pro-form-price-field{action 'saveCatalogTicket' ticket on='focus-out'} currency="usd" value=ticket.base_price class='inline-field inline-field-medium'
无法编译。关于如何将onFocusOut附加到自定义组件的任何想法?
答案 0 :(得分:1)
只需将focusOut功能放在pro-form-price-field.js
文件中。
import Ember from 'ember';
const { on } from Ember;
export default Ember.Component.extend({
focusIn(){
},
// or as Thernys pointed out use on event.
saveCatalogTicket: on('focusOut', function(){
})
});