เพิ่ม head table Drop&drop

This commit is contained in:
setthawutttty 2025-01-31 10:50:54 +07:00
parent 6941a6e4d6
commit 7e768afdb3
2 changed files with 9 additions and 12 deletions

View file

@ -227,7 +227,7 @@ const columns = ref<QTableProps["columns"]>([
* @param to ตำแหนงทจะยายไป
*/
function onDrop(from: number, to: number) {
rows.value.splice(to, 0, rows.value.splice(from, 1)[0]);
rows.value.splice(to - 1, 0, rows.value.splice(from - 1, 1)[0]);
selected.value.push(rows.value[0]);
}
@ -296,18 +296,11 @@ watch(modal, async () => {
row-key="id"
hide-bottom
hide-pagination
hide-header
selection="multiple"
class="custom-header-table"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.checkBox"
/>
</template>
<template v-slot:header-selection="scope"> </template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td>