mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 12:07:54 +08:00
24 lines
538 B
Vue
24 lines
538 B
Vue
import { Item } from '../Item';
|
|
|
|
export default function useChildren(
|
|
list,
|
|
startIndex,
|
|
endIndex,
|
|
setNodeRef,
|
|
renderFunc,
|
|
{ getKey },
|
|
) {
|
|
return list.slice(startIndex, endIndex + 1).map((item, index) => {
|
|
const eleIndex = startIndex + index;
|
|
const node = renderFunc(item, eleIndex, {
|
|
// style: status === 'MEASURE_START' ? { visibility: 'hidden' } : {},
|
|
});
|
|
const key = getKey(item);
|
|
return (
|
|
<Item key={key} setRef={ele => setNodeRef(item, ele)}>
|
|
{node}
|
|
</Item>
|
|
);
|
|
});
|
|
}
|