From b1df0e03da1f3a13728375eb5c250b19780bf114 Mon Sep 17 00:00:00 2001 From: Barrior Date: Tue, 9 Jul 2024 17:59:26 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=96=87=E6=A1=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/search-table-react/001-intro.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/search-table-react/001-intro.md b/examples/search-table-react/001-intro.md index 1d60991..e4b3e5f 100644 --- a/examples/search-table-react/001-intro.md +++ b/examples/search-table-react/001-intro.md @@ -86,7 +86,7 @@ const Demo = () => { export default Demo ``` -## 全功能一览 +## 全功能概览 ```tsx import { sleep } from '@examples/utils' @@ -109,6 +109,19 @@ const items = [ { key: '3', label: '待审核' }, ] +// 创建固定列 +const fixedColumns = columns.map((col, index) => { + const newCol = { ...col } + + if (index === 0) { + newCol.fixed = 'left' + } else if (index === columns.length - 1) { + newCol.fixed = 'right' + } + + return newCol +}) + // 模拟删除接口 const postDeleteBill = (_id: string) => sleep() @@ -167,7 +180,7 @@ const Demo = () => { }, }} table={{ - columns, + columns: fixedColumns, // 显示序号栏 showRowNumber: true, // 添加操作列与配置个数、宽度