-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(BasicTable): BasicTable resize wrong in modal (#3549)
- Loading branch information
Showing
8 changed files
with
222 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<BasicModal | ||
v-bind="$attrs" | ||
title="Modal Title" | ||
:helpMessage="['提示1', '提示2']" | ||
width="1000px" | ||
@fullscreen="onFullscreen" | ||
> | ||
<BasicTable @register="registerTable" ref="selectTable" /> | ||
</BasicModal> | ||
</template> | ||
<script lang="ts" setup> | ||
import { ref, nextTick } from 'vue'; | ||
import { BasicModal } from '@/components/Modal'; | ||
import { BasicTable, ColumnChangeParam, useTable } from '@/components/Table'; | ||
import { getBasicColumns } from '../../table/tableData'; | ||
import { demoListApi } from '@/api/demo/table'; | ||
const [registerTable] = useTable({ | ||
canResize: true, | ||
title: 'useTable示例', | ||
titleHelpMessage: '使用useTable调用表格内方法', | ||
api: demoListApi, | ||
columns: getBasicColumns(), | ||
defSort: { | ||
field: 'name', | ||
order: 'ascend', | ||
}, | ||
rowKey: 'id', | ||
showTableSetting: true, | ||
rowSelection: { | ||
type: 'checkbox', | ||
}, | ||
onColumnsChange: (data: ColumnChangeParam[]) => { | ||
console.log('ColumnsChanged', data); | ||
}, | ||
showSelectionBar: true, // 显示多选状态栏 | ||
}); | ||
const selectTable = ref<InstanceType<typeof BasicTable> | undefined>(); | ||
const onFullscreen = async () => { | ||
await nextTick(); | ||
selectTable.value?.redoHeight(); | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.