[英]show hide button depending on time in ember.js
如何在ember.js中隱藏5s的按鈕
這是我的模板activation.hbs
{{#if hideResendCode}}
{{#paper-button raised=true primary=true}}Resend Code{{/paper-button}}
{{/if}}
這是我的控制器activation.js
hideResendCode:Ember.run.later((function() {
}), 5000),
我不知道如何隱藏這個按鈕5s請幫助我。
您需要在init
運行scheduler。
{{#if showResendCode}}
{{#paper-button raised=true primary=true}}Resend Code{{/paper-button}}
{{/if}}
和
//activation.js
showResendCode: true,
init(){
this._super(...arguments);
Ember.run.later(this, function() {
this.set('showResendCode', false);
}, 5000);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.