1 首次出现的下标
const index = this.form.formlistTwo.findIndex(x => x.category_class === 1)
this.form.formlistTwo[index].show = true
本文介绍了一种在JavaScript中查找数组中特定元素首次出现的位置,并修改该位置元素属性的方法。通过使用findIndex方法,可以有效地定位到指定条件的元素并进行操作。
1 首次出现的下标
const index = this.form.formlistTwo.findIndex(x => x.category_class === 1)
this.form.formlistTwo[index].show = true
320
4645
241

被折叠的 条评论
为什么被折叠?
