0
我有幾個按鈕,像波紋管,所有包裝dom-if模板一樣。聚合物,紙張按鈕,發送參數on-tap作品,但有時不是
<teplate is="dom-if" if="{{google}}">
<paper-button on-tap='_signIn' arg="#google">...<div></div><paper-button>
</template>
.....
<paper-button on-tap='_signIn' arg="#facebook">...<div></div><paper-button>
<paper-button on-tap='_signIn' arg="#twitter">...<div></div><paper-button>
......
_signIn: function(e) {
console.log(e.target.getAttribute("arg"));
}
由於參數的價值,我需要使用自己的憑證登錄/註冊。 我隨機點擊這些按鈕,結果有時:null。控制檯日誌如下所示:
#google
#facebook
#google
null
null
null
#facebook
#facebook
#facebook
#twitter
null
所以需要穩定的結果。任何幫助或建議將不勝感激。
非常感謝您@KubaŠimonovský,第二選擇是對我來說更好,效果很好。真的非常有幫助。 :) – HakanC