1.0.7 • Published 5 years ago

react-indexlist v1.0.7

Weekly downloads
14
License
MIT
Repository
github
Last release
5 years ago

react-indexlist

npm.io npm.io

Description

Indexlist component based better-scroll for react。

Quick Start

Install

npm install react-indexlist --save

or yarn add react-indexlist

Usage

import IndexList from 'react-indexlist';
import 'react-indexlist/dist/index.css';
handleSelect = (item) => {
    console.log(item);
}

<IndexList data={arr} onSelect={this.handleSelect} className="my-indexlist" />

Example

indexlist

indexlist

indexlist

Prop types

propTypes: {

    // className of component
    className: PropTypes.string,

    // Array of list
    data: PropTypes.array.isRequired, // Default: Array<{ title: string, items: array<{ name: string }> }>

    // render item by self, return ReactNode
    renderItem: PropTypes.func, // function (item)

    // onClick item callback
    onSelect: PropTypes.func, // function (item)
}

License

MIT

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago