taro-index-list
v1.0.0
Published
Taro index-list 组件
Downloads
2
Readme
使用效果
使用案例
import IndexList from '@/components/IndexList';
import { View } from '@tarojs/components';
import { Fragment } from 'react';
import styles from './index.module.scss';
const IndexListTest = () => {
const customIndexList: any[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
const boxs = [1, 2, 3, 4, 5, 6];
return (
<View>
<View style={{ height: '200px', background: 'EEE' }}></View>
<IndexList indexList={customIndexList}>
{customIndexList.map((index, keyIndex) => (
<Fragment key={index}>
<IndexList.Anchor index={keyIndex} item={index} />
{boxs.map(x => (
<View className={styles.box} key={x}>
文本{x}
</View>
))}
</Fragment>
))}
</IndexList>
</View>
);
};
export default IndexListTest;