let allChecked = _.every(this.collection, this.checked);我有這個(gè)現(xiàn)有代碼,如果集合中的每個(gè)項(xiàng)目的屬性都為 true,則該代碼將返回 true checked。我想修改它,以便只迭代另一個(gè)屬性上不具有 true 的項(xiàng)目,而不是迭代集合中的每個(gè)項(xiàng)目。disabled即,集合中的項(xiàng)目還有另一個(gè)屬性。如果此屬性設(shè)置為 true,我想在此_.every()檢查中完全忽略這些項(xiàng)目。
如何使用 lodash 檢查集合中的所有項(xiàng)目(不符合我的條件的項(xiàng)目除外)?
Helenr
2023-11-11 20:53:34