Package Exports
- react-native-scrolltab
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-scrolltab) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ScrollTab
效果展示
安装方法
npm i --save react-native-scrolltab
js 调用
import ScrollTab from 'react-native-scrolltab';
export default class exsample extends Component {
// 构造
constructor(props) {
super(props);
// 初始状态
this.state = {
activeTab: 0
};
}
render() {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF'}}}>
<ScrollTab tabs={['item1','item2','item3','item-4-item','item5','item6','item7','item8']}
activeTab={this.state.activeTab}
goToPage={(index)=>{this.setState({activeTab: index})}}
/>
</View>
);
}
}