Просмотр исходного кода

fix: batch upgrader button always disabled

Jacky 6 месяцев назад
Родитель
Сommit
7ea0aad938
1 измененных файлов с 8 добавлено и 3 удалено
  1. 8 3
      app/src/components/StdDesign/StdDataDisplay/StdCurd.vue

+ 8 - 3
app/src/components/StdDesign/StdDataDisplay/StdCurd.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts" generic="T=any">
 import type { Column } from '@/components/StdDesign/types'
-import type { ComputedRef, Ref } from 'vue'
+import type { ComputedRef } from 'vue'
 import type { StdTableProps } from './StdTable.vue'
 import StdBatchEdit from '@/components/StdDesign/StdDataDisplay/StdBatchEdit.vue'
 import StdCurdDetail from '@/components/StdDesign/StdDataDisplay/StdCurdDetail.vue'
@@ -25,8 +25,13 @@ export interface StdCurdProps<T> extends StdTableProps<T> {
 
 const props = defineProps<StdTableProps<T> & StdCurdProps<T>>()
 
-const selectedRowKeys = ref<(string | number)[]>([])
-const selectedRows: Ref<T[]> = ref([])
+const selectedRowKeys = defineModel<(number | string)[]>('selectedRowKeys', {
+  default: () => reactive([]),
+})
+
+const selectedRows = defineModel<T[]>('selectedRows', {
+  default: () => reactive([]),
+})
 
 const visible = ref(false)
 // eslint-disable-next-line ts/no-explicit-any