Commit 4b7e7d61f7e2e44dd3f3a35435db3e2b5da9271e
1 parent
77067a11
fix: bugs
Showing
2 changed files
with
17 additions
and
2 deletions
yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts
| 1 | -import { reactive } from 'vue' | |
| 1 | +import { computed, reactive } from 'vue' | |
| 2 | 2 | import { VxeGridProps } from 'vxe-table' |
| 3 | +import { useAppStore } from '@/store/modules/app' | |
| 4 | + | |
| 5 | +const appStore = useAppStore() | |
| 6 | + | |
| 7 | +const currentSize = computed(() => { | |
| 8 | + if (appStore.getCurrentSize === 'small') { | |
| 9 | + return 'small' | |
| 10 | + } else if (appStore.getCurrentSize === 'large') { | |
| 11 | + return 'mini' | |
| 12 | + } else { | |
| 13 | + return 'medium' | |
| 14 | + } | |
| 15 | +}) | |
| 3 | 16 | |
| 4 | 17 | export const useVxeGrid = (allSchemas, getPageApi) => { |
| 5 | 18 | const gridOptions = reactive<VxeGridProps>({ |
| 6 | 19 | loading: false, |
| 20 | + size: currentSize.value, | |
| 7 | 21 | height: 800, |
| 8 | 22 | rowConfig: { |
| 9 | 23 | keyField: 'id', |
| 24 | + isCurrent: true, | |
| 10 | 25 | isHover: true |
| 11 | 26 | }, |
| 12 | 27 | toolbarConfig: { | ... | ... |
yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue