Skip to content

Commit e8a48d2

Browse files
committed
fix: table cannot scroll horizontally in mobile devices
1 parent 4ab34fd commit e8a48d2

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

app/auto-imports.d.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ declare global {
9090
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
9191
import('vue')
9292
}
93-
9493
// for vue template auto import
9594
import { UnwrapRef } from 'vue'
9695
declare module 'vue' {
@@ -174,4 +173,4 @@ declare module 'vue' {
174173
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
175174
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
176175
}
177-
}
176+
}

app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@xterm/addon-attach": "^0.11.0",
2626
"@xterm/addon-fit": "^0.10.0",
2727
"@xterm/xterm": "^5.5.0",
28-
"ant-design-vue": "^4.2.5",
28+
"ant-design-vue": "^4.2.6",
2929
"apexcharts": "^3.54.1",
3030
"axios": "^1.7.7",
3131
"dayjs": "^1.11.13",

app/pnpm-lock.yaml

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/components/StdDesign/StdDataDisplay/StdTable.vue

+11-3
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ const paginationSize = computed(() => {
472472
:pagination="false"
473473
:row-key="rowKey"
474474
:row-selection="rowSelection"
475-
:scroll="{ x: scrollX }"
475+
:scroll="{ x: scrollX ?? true }"
476476
:size="size as any"
477477
:expanded-row-keys="expandKeysList"
478478
@change="onTableChange"
@@ -483,7 +483,7 @@ const paginationSize = computed(() => {
483483
<span class="ant-table-drag-icon"><HolderOutlined /></span>
484484
{{ text }}
485485
</template>
486-
<template v-if="column.dataIndex === 'action'">
486+
<div v-if="column.dataIndex === 'action'" class="action">
487487
<template v-if="!props.disableView && !inTrash">
488488
<AButton
489489
type="link"
@@ -559,7 +559,7 @@ const paginationSize = computed(() => {
559559
</AButton>
560560
</APopconfirm>
561561
</template>
562-
</template>
562+
</div>
563563
</template>
564564
</ATable>
565565
<StdPagination
@@ -611,6 +611,14 @@ const paginationSize = computed(() => {
611611
display: none;
612612
}
613613
}
614+
615+
.action {
616+
@media (max-width: 768px) {
617+
.ant-divider-vertical {
618+
display: none;
619+
}
620+
}
621+
}
614622
</style>
615623

616624
<style lang="less">

app/src/views/site/site_list/columns.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const columns: Column[] = [{
1818
type: input,
1919
},
2020
search: true,
21+
minWidth: 400,
2122
}, {
2223
title: () => $gettext('Category'),
2324
dataIndex: 'site_category_id',
@@ -34,6 +35,7 @@ const columns: Column[] = [{
3435
sorter: true,
3536
pithy: true,
3637
batch: true,
38+
minWidth: 200,
3739
}, {
3840
title: () => $gettext('Status'),
3941
dataIndex: 'enabled',
@@ -60,15 +62,18 @@ const columns: Column[] = [{
6062
},
6163
sorter: true,
6264
pithy: true,
65+
minWidth: 100,
6366
}, {
6467
title: () => $gettext('Updated at'),
6568
dataIndex: 'modified_at',
6669
customRender: datetime,
6770
sorter: true,
6871
pithy: true,
72+
minWidth: 200,
6973
}, {
7074
title: () => $gettext('Action'),
7175
dataIndex: 'action',
76+
minWidth: 300,
7277
}]
7378

7479
export default columns

0 commit comments

Comments
 (0)