Package Exports
- wumu-edit-table
- wumu-edit-table/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wumu-edit-table) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
wumu-edit-table
A react library developed with dumi based on dumi v2
Usage
# install dependencies
$ npm i wumu-edit-table简单使用:定义表头和数据;定义当前编辑的单元格editId;定义当前数据dataSource
import React, { useState } from 'react';
import { EditTable } from 'wumu-edit-table';
export default () => {
const [editId, onEdit] = useState('');
const columns = [
{
title: 'A',
dataIndex: 'A',
width: 300,
},
{
title: 'B',
dataIndex: 'B',
},
{
title: 'C',
dataIndex: 'C',
width: 300,
},
{
title: 'D',
dataIndex: 'D',
},
{
title: 'E',
dataIndex: 'E',
width: 380,
},
{
title: 'F',
dataIndex: 'F',
width: 300,
},
];
const dataSource = [
{
A: '干嘛',
B: '哎哟',
C: 'haha',
D: '噶速度进来看哈流口水的份',
E: 'guaiosdjlkgjasdgasdg',
},
{
A: 'adsfads',
B: 'ghdfgjgh',
C: 'adsfasdfad',
D: '噶速度进来看哈流口水的份',
E: 'guaiosdjlkgjasdgasdg',
},
{ A: 'adsfads', B: 'ghdfgjgh', C: 'adsfasdfad' },
];
const [list, setList] = useState(dataSource)
return (
<EditTable
editId={editId}
onEdit={onEdit}
columns={columns}
dataSource={list}
maxHeight={320}
onChange={(newList) => setList(newList)}
/>
);
};
TODO 行内新增和删除 自定义 render 更多的输入框类型:select、checkbox
Options
即将推出
Development
LICENSE
MIT