【发布时间】:2021-02-21 03:25:02
【问题描述】:
在 onChangeDistrict 之后需要 initTableData 和 initTableFiltered,我希望现在不要使用它,而是只使用 initTableFiltered
data () {
return {
data: []
}
},
created () {
this.initTableData()
},
methods() {
initTableData () {
db.collection('example').orderBy('owner_name', 'asc').get().then(res => {
res.forEach((doc) => {
this.data.push({
id: doc.id,
})
})
})
},
initTableFiltered () {
db.collection('filter').orderBy('name', 'asc').get().then(res => {
res.forEach((doc) => {
this.data.push({
id: doc.id,
})
})
}
onChangeDistrict () {
this.initTablefiltered()
}
}
那么如何在 onChangeDistrict 上重新初始化 initTablefiltered 呢?
【问题讨论】:
标签: javascript firebase vue.js