
要想判断数组对象中嵌套的数组对象中是否有字段isBig==true
可以采用计数器的方法
if (type == 'all') {
let current = 0 // eslint-disable-line no-unused-vars
list.map((item, index) => {
for (const item of item.pkgItemList) {
if (item.isBig == true) {
current++
}
}
})
if (current > 0) {
this.$confirm(this.$t('order.ConfirmCreatePkg'), this.$t('button.Confirm'), {
confirmButtonText: this.$t('button.Confirm'),
cancelButtonText: this.$t('button.Cancel'),
type: 'warning'
})
最后
以上就是疯狂发箍最近收集整理的关于判断数组对象嵌套的数组对象中是否含有某个字段的全部内容,更多相关判断数组对象嵌套内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复