1
我有許多電報鍵盤在我火力地堡,我想童車特定鍵盤的用戶點擊,
而msg.text
是我的鍵盤的可變從火力地堡讀變量童車
const ref = db.ref('Keyboards/Keyboard1/childs'); //keyboard 1
const ref = db.ref('Keyboards/Keyboard2/childs'); //keyboard 2
const ref = db.ref('Keyboards/Keyboard3/childs'); //keyboard 3
如何添加Keyboard[n]
,我的意思是msg.text
在我的ref
?
如果我輸入msg.text
是= Keyboard1
我得到Keyboard1
童車和...
它沒有工作
const ref = db.ref('Keyboards/msg.text/childs');
注意當我的項目是當地的本地JSON,我用下面的代碼爲此和Works Fine:
locale.keyboards[msg.text].childs
您是否嘗試使用db.ref('Keyboards /'+ msg.text +'/ childs'); – hasan
謝謝。解決 –
歡迎:) – hasan