9 |
--------------------------------------------------------------------------------
/docs/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Basic
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/height.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Height
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/horizontal-scroll.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Horizontal Scroll
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
--------------------------------------------------------------------------------
/docs/demo/nest.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Nest
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/no-virtual.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: No Virtual
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/switch.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Switch
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: rc-virtual-list
3 | ---
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/animate.less:
--------------------------------------------------------------------------------
1 | .motion {
2 | transition: all 0.3s;
3 | }
4 |
5 | .item {
6 | display: inline-block;
7 | box-sizing: border-box;
8 | margin: 0;
9 | padding: 0 16px;
10 | overflow: hidden;
11 | line-height: 31px;
12 | position: relative;
13 |
14 | &:hover {
15 | background: rgba(255, 0, 0, 0.1);
16 | }
17 |
18 | &::after {
19 | content: '';
20 | border-bottom: 1px solid gray;
21 | position: absolute;
22 | bottom: 0;
23 | left: 0;
24 | right: 0;
25 | }
26 |
27 | button {
28 | vertical-align: text-top;
29 | margin-right: 8px;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/examples/animate.tsx:
--------------------------------------------------------------------------------
1 | /* eslint-disable arrow-body-style */
2 |
3 | import * as React from 'react';
4 | // @ts-ignore
5 | import CSSMotion from 'rc-animate/lib/CSSMotion';
6 | import classNames from 'classnames';
7 | import List, { ListRef } from '../src/List';
8 | import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
9 | import './animate.less';
10 |
11 | let uuid = 0;
12 | function genItem() {
13 | const item = {
14 | id: `key_${uuid}`,
15 | uuid,
16 | };
17 | uuid += 1;
18 | return item;
19 | }
20 |
21 | const originData: Item[] = [];
22 | for (let i = 0; i < 1000; i += 1) {
23 | originData.push(genItem());
24 | }
25 |
26 | interface Item {
27 | id: string;
28 | uuid: number;
29 | }
30 |
31 | interface MyItemProps extends Item {
32 | visible: boolean;
33 | motionAppear: boolean;
34 | onClose: (id: string) => void;
35 | onLeave: (id: string) => void;
36 | onAppear: (...args: any[]) => void;
37 | onInsertBefore: (id: string) => void;
38 | onInsertAfter: (id: string) => void;
39 | }
40 |
41 | const getCurrentHeight = (node: HTMLElement) => ({ height: node.offsetHeight });
42 | const getMaxHeight = (node: HTMLElement) => {
43 | return { height: node.scrollHeight };
44 | };
45 | const getCollapsedHeight = () => ({ height: 0, opacity: 0 });
46 |
47 | const MyItem: React.ForwardRefRenderFunctionCurrent: {data.length} records
181 | 182 |
19 | `,
20 | 'utf8',
21 | function(error) {
22 | if(error){
23 | console.log(error);
24 | return false;
25 | }
26 | console.log(`${name} 更新成功~`);
27 | }
28 | )
29 | });
30 |
--------------------------------------------------------------------------------