|
@@ -6,7 +6,7 @@
|
|
|
<view v-if="checkIconPositon=='right'" style="flex-grow: 1;" class="title">{{ item[titleKeys] }}</view>
|
|
|
<view>
|
|
|
<radio v-if="types == 'radio'" :checked="item.checked" :value="item.id" />
|
|
|
- <checkbox v-if="types == 'checkbox'" :checked="item.checked" :value="item.id" />
|
|
|
+ <u-checkbox v-if="types == 'checkbox'" :disabled="item.disabled" v-model="item.checked" :name="item.id" />
|
|
|
</view>
|
|
|
<view v-if="checkIconPositon=='left'" class="title">{{ item[titleKeys] }}</view>
|
|
|
</view>
|
|
@@ -104,10 +104,14 @@ export default {
|
|
|
})
|
|
|
item.checked = a>=0
|
|
|
this.list.splice(index,1,item)
|
|
|
+ console.log(this.list,'this.list')
|
|
|
})
|
|
|
},
|
|
|
// 选中
|
|
|
chooseItem(item) {
|
|
|
+ if (item.disabled) {
|
|
|
+ return
|
|
|
+ }
|
|
|
// 单选
|
|
|
if (this.types == 'radio') {
|
|
|
this.value[0] = this.backValue == 'idArr' ? item.id : item;
|
|
@@ -115,10 +119,10 @@ export default {
|
|
|
} else {
|
|
|
// 取消选中
|
|
|
if (item.checked) {
|
|
|
+ this.value.push(this.backValue == 'idArr' ? item.id : item);
|
|
|
+ } else {
|
|
|
let index = this.backValue == 'idArr' ? this.value.indexOf(item.id) : this.value.findIndex(a=> a.id == item.id);
|
|
|
this.value.splice(index, 1);
|
|
|
- } else {
|
|
|
- this.value.push(this.backValue == 'idArr' ? item.id : item);
|
|
|
}
|
|
|
}
|
|
|
this.hasCheck();
|