uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue
253行,改一下这个方法
onClick(e) {
let {
idx,
index
} = e
let obj = {}
for (let key in this.lists[idx].items[index]) {
obj[key] = this.lists[idx].items[index][key]
}
let select = []
if (this.showSelect) {
// this.lists[idx].items[index].checked = !this.lists[idx].items[index].checked
this.lists.forEach((value, idx) => {
value.items.forEach((item, index) => {
item.checked = false
if(e.idx == idx && e.index == index){
item.checked = true
let obj = {}
for (let key in this.lists[idx].items[index]) {
obj[key] = this.lists[idx].items[index][key]
}
select.push(obj)
}
// if (item.checked) {
// let obj = {}
// for (let key in this.lists[idx].items[index]) {
// obj[key] = this.lists[idx].items[index][key]
// }
// select.push(obj)
// }
})
})
}
this.$emit('click', {
item: obj,
select: select
})
}
1 个回复
喜欢技术的前端 - QQ---445849201
uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue
253行,改一下这个方法