在vue2中,如果不想在数组中显示某个索引,可以执行以下操作:
this.tasks = this.tasks.filter((task) => task.id !== 1)在其中,它将显示“tasks”数组中的所有值,但具有id=1的任务除外。
现在,在vue3中使用任务作为参考值:const tasks = ref([])
您将如何在vue2中使用vue3进行等效操作?
发布于 2022-11-03 19:42:15
类似地,对于参考使用属性value,请尝试使用:
tasks.value = tasks.value.filter((task) => task.id !== 1)https://stackoverflow.com/questions/74308310
复制相似问题