0
我已經聲明的屬性是這樣的:改變屬性值在聚合物
static get properties() {
return {
auth1: {
type: Boolean,
readonly: false,
value: false,
notify: true
}
};
}
在我的聚合物元件
。現在我有這個功能:
connect(){
this.auth1.value = true;
console.log("Authenticated" + this.authenticated);
}
這應該改變屬性值爲true。每次我調用函數我有錯誤「TypeError:試圖分配給只讀屬性。」。但我已經在我的財產中只讀了假。我的功能被稱爲這樣一個按鈕: <button id="loginbutton" on-tap="connect">Click me!</button>
任何人都可以幫助我嗎?
有一件事:O應該大寫:只讀:false – Bruce
感謝您的提示! – Boerne