diff --git a/src/components/AntDesignVue/CustomAntDesignVue/TableColumChoose/index.vue b/src/components/AntDesignVue/CustomAntDesignVue/TableColumChoose/index.vue index d9149e5..f578789 100644 --- a/src/components/AntDesignVue/CustomAntDesignVue/TableColumChoose/index.vue +++ b/src/components/AntDesignVue/CustomAntDesignVue/TableColumChoose/index.vue @@ -13,8 +13,7 @@ const props = defineProps({ const status = ref(false); const checkedKeys = ref(props.columnList.filter((item) => item.status === true).map((item) => item.key)); -const handleClose = () => { -}; +const handleClose = () => {}; watch(checkedKeys, (newVal) => { props.columnList.forEach((item) => { if (checkedKeys.value.includes(item.key)) { @@ -24,18 +23,28 @@ watch(checkedKeys, (newVal) => { } }); }); +// ! 排序 const onDrop = (info) => { const before = info.dragNode.pos.split('-').slice(-1)[0]; const after = info.node.pos.split('-').slice(-1)[0]; const target = props.columnList.splice(before, 1)[0]; props.columnList.splice(after, 0, target); }; +// ! 全选 +function chooseAll() { + checkedKeys.value = props.columnList.map((item) => { + item.status = true; + return item.key; + }); +}