0.6.5 • Published 7 years ago
rax-gotop v0.6.5
Gotop
Install
$ npm install --save rax-gotop
Import
import GoTop from 'rax-gotop';
default style:
<GoTop />
user defined style:
<GoTop name="click" icon="//gtms03.alicdn.com/tps/i3/TB1rrfVJVXXXXalXXXXGEZzGpXX-40-40.png" />
Note: weex environment must be placed in the first position of ScrollView
Props
name | type | default | describe |
---|---|---|---|
name | String | Top | icon text content |
icon | String | default icon | icon URL |
iconWidth | String | 90 | container width |
iconHeight | String | 90 | container height |
borderColor | String | rgba(0, 0, 0, 0.1) | container border color |
bottom | int | 80 | distance from bottom |
onShow | function | function() {} | icon display callback |
onHide | function | function() {} | icon disappear callback |
Example
// demo
import { createElement, render, Component } from 'rax';
import GoTop from 'rax-gotop';
import ScrollView from 'rax-scrollview';
import Text from 'rax-text';
class GoTopDemo extends Component {
render() {
return (
<ScrollView ref={(scrollview) => {
this.scrollview = scrollview;
}}>
<GoTop name="Top" style={{width: 100, height: 100}}
onTop={() => {
this.scrollview.scrollTo({y: 0});
}}
icon="//gtms03.alicdn.com/tps/i3/TB1rrfVJVXXXXalXXXXGEZzGpXX-40-40.png" />
{Array.from({length: 50}).map((_, idx) => (
<Text style={{fontSize: 50}}>hello world {idx}</Text>
))}
</ScrollView>
);
}
}
render(<GoTopDemo />);
0.6.5
7 years ago
0.6.4
7 years ago
0.6.3
7 years ago
0.6.2
7 years ago
0.6.0
7 years ago
0.5.4
7 years ago
0.5.2
7 years ago
0.5.1
7 years ago
0.5.0
8 years ago
0.4.20
8 years ago
0.4.19
8 years ago
0.4.18
8 years ago
0.4.17
8 years ago
0.4.16
8 years ago
0.4.15
8 years ago
0.5.0-beta
8 years ago
0.4.14
8 years ago
0.4.13
8 years ago
0.4.12
8 years ago
0.4.11
8 years ago
0.4.10
8 years ago
0.4.9
8 years ago
0.4.8
8 years ago
0.4.7
8 years ago
0.4.6
8 years ago
0.4.5
8 years ago
0.4.4
8 years ago
0.4.3
8 years ago
0.4.2
8 years ago
0.4.1
8 years ago
0.4.0
8 years ago
0.3.8
8 years ago
0.3.7
8 years ago
0.3.6
8 years ago
0.3.5
8 years ago
0.3.4
8 years ago
0.3.3
8 years ago
0.3.2
8 years ago
0.3.1
8 years ago
0.3.0
8 years ago
0.2.11
8 years ago
0.2.10
8 years ago
0.2.9
8 years ago
0.2.8
8 years ago
0.2.7
8 years ago
0.2.6
8 years ago
0.2.5
8 years ago
0.2.4
8 years ago
0.2.3
8 years ago