如何设置vuefire路径,如下所示
export default {
firebase: {
classlist: db.ref('chapter/1'), // here 1 need to be taken from data
// like this db.ref('chapter/' + this.chapterid),
},
data:{
chapterid:''
},
mounted:{
// getchapterid here
this.chapterid=getChapterId()
}
}它不工作,它返回错误未定义的章节It,有没有办法这样做?
发布于 2018-03-16 08:44:26
对firebase使用函数语法,否则this不会绑定到vue实例。
firebase() {
return {
classlist: db.ref('chapter/' + this.chapterid)
}
},
来源:https://github.com/vuejs/vuefire/issues/90
https://stackoverflow.com/questions/48482777
复制相似问题