簡體   English   中英

show hide按鈕取決於ember.js中的時間

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM