diff --git a/packages/select-table-modal/index.vue b/packages/select-table-modal/index.vue index 4ec3983..9bd36e4 100644 --- a/packages/select-table-modal/index.vue +++ b/packages/select-table-modal/index.vue @@ -2,7 +2,7 @@ * @Author: zhaojinfeng 121016171@qq.com * @Date: 2023-07-18 12:30:07 * @LastEditors: zhaojinfeng 121016171@qq.com - * @LastEditTime: 2023-08-14 12:25:07 + * @LastEditTime: 2023-08-16 11:45:31 * @FilePath: \vue3\packages\select-table-modal\index.vue * @Description: 模态框选择表格 * @@ -115,7 +115,8 @@ const props = withDefaults( /** 是否多选 */ multiple?: boolean zIndex?: number - multipleFormattter?: (row: Record) => any + /** 单击确认按钮后的数据格式化函数 */ + formattter?: (row: Record) => any }>(), { hidePagination: false, @@ -128,7 +129,7 @@ const props = withDefaults( title: '选择', emptyText: '暂无数据', zIndex: 2023, - multipleFormattter(row: Record) { + formattter: (row: Record) => { return { ...row } }, }, @@ -185,7 +186,7 @@ const queryParams = reactive({ }) function initSelections() { - const rows = tableData.map(props.multipleFormattter) + const rows = tableData.map(props.formattter) tableRef?.toggleRowSelection(rows, true) } function initSelection() { @@ -218,7 +219,7 @@ async function getList() { /** 多选框选中数据 */ function handleSelectionChange(rows: any[]) { - selections = rows.map(props.multipleFormattter) + selections = rows.map(props.formattter) } function confirm() { if (props.multiple) {