|
|
@@ -31,14 +31,14 @@ Component({
|
|
|
this.setData({ options });
|
|
|
},
|
|
|
'options'(options: AnyArray) {
|
|
|
- this.setData({ hasSelected: options.some(option => option.checked) });
|
|
|
+ this.setData({ hasSelected: options.filter(option => !option.hide).some(option => option.checked) });
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
handleTop(event: HandleEvent) {
|
|
|
const { mark: { item } } = event;
|
|
|
if (!item || !this.data.active) return;
|
|
|
- const index = this.data.options.findIndex(option=>option.id === item.id);
|
|
|
+ const index = this.data.options.findIndex(option => option.id === item.id);
|
|
|
const multiple = this.data.payload.multiple;
|
|
|
const checked = !item.checked;
|
|
|
const options = this._handle(this.data.options, item, index, multiple);
|
|
|
@@ -48,7 +48,7 @@ Component({
|
|
|
handleSub(event: HandleEvent) {
|
|
|
const { mark: { item } } = event;
|
|
|
if (!item || !this.data.active) return;
|
|
|
- const index = this.data.subOptions.findIndex(option=>option.id === item.id);
|
|
|
+ const index = this.data.subOptions.findIndex(option => option.id === item.id);
|
|
|
const multiple = this.data.subMultiple;
|
|
|
const checked = !item.checked;
|
|
|
const subOptions = this._handle(this.data.subOptions, item, index, multiple);
|