feat(pool): add table-driven account batch actions

This commit is contained in:
elky
2026-07-19 16:09:20 +08:00
parent 95053f9502
commit 644ae9c1bf
20 changed files with 1403 additions and 1095 deletions
+12 -1
View File
@@ -1,20 +1,23 @@
<template>
<input
ref="inputRef"
type="checkbox"
:class="checkboxClass"
v-bind="$attrs"
:checked="isChecked"
:aria-checked="indeterminate ? 'mixed' : isChecked"
@change="handleChange"
>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { computed, ref, watchEffect } from 'vue'
import { cn } from '@/lib/utils'
interface Props {
modelValue?: boolean
checked?: boolean
indeterminate?: boolean
class?: string
}
@@ -38,6 +41,14 @@ const isChecked = computed<boolean>(() => {
return props.modelValue ?? false
})
const inputRef = ref<HTMLInputElement | null>(null)
watchEffect(() => {
if (inputRef.value) {
inputRef.value.indeterminate = props.indeterminate ?? false
}
}, { flush: 'post' })
function handleChange(event: Event) {
const target = event.target as HTMLInputElement
const value = target.checked