nuke-image-viewer
v2.0.4
Published
全屏图片查看器
Downloads
11
Readme
NukeImageViewer
- category: Components
- chinese: 全屏图片查看
- type: 基本
设计思路
仅支持 h5
API
| 参数 | 说明 | 类型 | 默认值 | | --------- | -------------- | -------- | ------ | | imageList | 图片列表 | array | | current | 当前默认项序号 | number | 0 | | onChange | 切换回调 | Function | |infinite|是否循环|boolean|true|
demo
import { createElement, Component, render } from 'rax';
import View from 'nuke-view';
import Text from 'nuke-text';
import ImageView from 'nuke-image-viewer';
const data = [
'http://img.alicdn.com/tps/TB1SrmcOVXXXXXFXpXXXXXXXXXX-520-280.jpg',
'http://img.alicdn.com/tfs/TB1xCFCPVXXXXchXXXXXXXXXXXX-160-160.gif',
'https://img.alicdn.com/tfs/TB1YhwQnlTH8KJjy0FiXXcRsXXa-361-639.jpg'
];
let App = class NukeDemoIndex extends Component {
constructor() {
super();
}
componentDidMount() {}
render() {
return (
<View style={{ flex: 1 }}>
<ImageView
imageList={data}
current={1}
onChange={index => {
//console.log(index);
}}
/>
</View>
);
}
};
render(<App />);