一个用于可滑动视图的 React 组件。 :snowflake:
Package Version Download Size (kB gzipped) react-swipeable-views 5.08 react-swipeable-views-utils 3.52 react-swipeable-views-native ?A React component for swipeable views.
npm install --save react-swipeable-views
npm install --save react-swipeable-views-native
Check out the demos from a mobile device (real or emulated). It's tiny (<10 kB gzipped), it quickly renders the first slide, then lazy-loads the others.
import React from 'react';
import SwipeableViews from 'react-swipeable-views';
const styles = {
slide: {
padding: 15,
minHeight: 100,
color: '#fff',
},
slide1: {
background: '#FEA900',
},
slide2: {
background: '#B3DC4A',
},
slide3: {
background: '#6AC0FF',
},
};
const MyComponent = () => (
<SwipeableViews>
</SwipeableViews>
);
export default MyComponent;
react-native support is experimental and I have no plan pushing it forward. I start to think that lower level abstraction to share the implementation between the platforms are more appropriate. We have two different implementations of the react-swipeable-views API.
…
This project is licensed under the terms of the MIT license.
暂无开放 Issues,或尚未同步最近议题。