当输入焦点时,我必须调用'route'动作。
template.js:
{{input value=password type="password" focus-out="passwordValidate" class="form-control"}}
route.js:
actions : {
passwordValidate : function(){
if(this.get('password').length<6){
this.set('validPassword',false);
}else{
this.set('validPassword',true);
}
}
}
但是这个动作并未被调用。代码怎么了?
答案 0 :(得分:0)
您尚未加入focus-in
{{input value=password type="password" focus-in="passwordFocus" focus-out="passwordValidate" class="form-control"}}
passwordValidate
而忘记了return true
冒泡路线?