【发布时间】:2020-10-01 01:21:23
【问题描述】:
我在我的 Vuex 应用中使用 firebase。我在 vuex 中有这个动作
async deleteTodo({ commit }, id) {
await fbs.database().ref(`/todolist/${store.state.auth.userId}/${id}`)
.remove()
.then(() => {
// fix this
console.log('Todo deleted', commit);
})
}
如果我不需要提交某些内容,我如何跳过参数中的{commit}。我有类似“提交已分配但从未使用过”之类的错误
【问题讨论】:
-
不要解构对象,只使用占位符下划线:deleteTodo(_, id)
标签: javascript firebase vue.js firebase-realtime-database vuex