Commit 4bb0c461 by haojie

1

parent bb6af5cb
......@@ -8,7 +8,11 @@
:loading="loading"
>
<template #check_all>
<TCheckbox class="check-all-box" @change="CheckAll"></TCheckbox>
<TCheckbox
class="check-all-box"
v-model="is_check_all"
@change="CheckAll"
></TCheckbox>
</template>
<template #checkbox="{ row }">
<TCheckbox v-model="row.is_check" class="check-all-box"></TCheckbox>
......@@ -69,6 +73,8 @@ const loading = ref(false);
const pageNum = ref<number>(getPage());
const pageSize = ref<number>(10);
const total = ref<number>(0);
// 是否选择全部
const is_check_all = ref(false);
const tableList = reactive({
list: [],
});
......@@ -82,7 +88,7 @@ const pageChange = (value: number) => {
// 选择全部
const CheckAll = () => {
tableList.list.forEach((item: any) => {
item.is_check = !item.is_check;
item.is_check = is_check_all.value;
});
};
......
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