0
在Firebase中,我具有功能addSubmit
,該功能旨在將數據Do the dishes
提交到名爲addnote
的陣列。但是,我不知道如何讓push方法發送到數組。我的代碼如下。使用Firebase存儲陣列
addSubmit(){
var self = this;
var user = firebase.auth().currentUser;
var getUserInfo = firebase.database().ref('users/' + user.uid);
if (user){
getUserInfo.push({
addnote: ["Do the dishes"]
});
}
}
我推法捲起給我幾個addnote
數組來代替放置的Do the dishes
所有字符串在同一個。所以它看起來像:
addnote - 'Do the dishes'
addnote - 'Do the dishes'
至於反對:
addnote - 'Do the dishes', 'Do the dishes'
我將如何重新安排我的代碼,以使這項工作?