Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 9, 2023
1 parent 345e6f7 commit 88a8287
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions packages/react-collapse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,6 @@ Collapse 折叠面板

可以折叠/展开的内容区域。

```jsx
import { Collapse } from 'uiw';
// or
import Collapse from '@uiw/react-collapse';
```

```jsx mdx:preview&bg=#fff
import React, { useState } from 'react';
import { Collapse } from 'uiw';

const styl = {
border: '1px solid #efefef',
marginBottom: 10,
//height: 32,
//lineHeight: 32,
padding: 10,
}

export default function App() {
const [recent, setRecent] = useState([]);
const [list, setList] = useState(["a", "b", "c", "d", "e"]);
const onListClick = (index) => {
const newList = [...list];
const ls = newList.splice(index, 1);
setRecent([...recent, ls]);
setList(newList);
};
const onRecentClick = (index) => {
const newRecent = [...recent];
const ls = newRecent.splice(index, 1);
setList([...list, ls]);
setRecent(newRecent);
};
return (
<div className="App">
{/* <Scrollbars autoHide> */}
<Collapse>
<Collapse.Panel header="Test1">
{recent.map((item) => {
return (
<div className="item" style={styl} key={item} onClick={onRecentClick}>
{item}
</div>
);
})}
</Collapse.Panel>
<Collapse.Panel header="Tset2">
{list.map((item) => {
return (
<div className="item" key={item} style={styl} onClick={onListClick}>
{item}
</div>
);
})}
</Collapse.Panel>
</Collapse>
{/* </Scrollbars> */}
</div>
);
}


```
## 基本用法
Expand Down

0 comments on commit 88a8287

Please sign in to comment.