Commit b3e2d4a7 by 姜雷

穿梭框添加双击选择取消功能

parent 3488571b
......@@ -25,6 +25,10 @@ export default {
id: 3,
label: '3333',
},
{
id: 4,
label: '3223',
},
],
value: [],
};
......
......@@ -28,6 +28,7 @@
v-for="(item, index) in allDataOptions"
:key="index"
:value="getValue('key',item)"
@dblclick="() => addClickValue(getValue('key',item))"
>{{getValue('label',item)}}</option>
</select>
</div>
......@@ -101,6 +102,7 @@
v-for="(item, index) in selectDataOptions"
:key="index"
:value="getValue('key',item)"
@dblclick="() => removeClickValue(getValue('key',item))"
>{{getValue('label',item)}}</option>
</select>
</div>
......@@ -184,9 +186,15 @@ export default {
filterSelectedData() {
this.filters.selectedValue = this.filters.selected;
},
addClickValue(val) {
this.trueValue.push(val);
},
removeClickValue(val) {
this.trueValue = this.trueValue.filter(item => item !== val);
},
addSelectedValue(flag) {
this.trueValue = flag
? this.list.map(i => i.id)
? this.allDataOptions.map(i => i.id)
: [...this.trueValue, ...this.selected.all];
},
removeSelectedValue(flag) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment