UNPKG

weex-nuke

Version:

基于 Rax 、Weex 的高性能组件体系 ~~

65 lines (56 loc) 1.18 kB
# Progress 基本用法 - order: 0 - title_en: Progress usage --- ```js /** @jsx createElement */ import { View, Text, Button, Page, Progress } from 'weex-nuke'; <NukePlayGround> <Progress rate={0.6} style={styles.progress} /> </NukePlayGround> ``` --- ```js import { createElement, Component, render } from 'rax'; let App = class NukeDemoIndex extends Component { constructor() { super(); this.changeRate = this.changeRate.bind(this); this.state = { rate: 0.8 }; } changeRate() { this.setState({ rate: 0.6 }); } render() { return ( <Page title="Progress"> <Page.Intro main="基础样式" /> <View style={styles.line}> <Progress rate={this.state.rate} style={styles.progress} /> </View> <Button type="primary" onPress={this.changeRate}> 点我 </Button> <View style={styles.line}> <Progress rate={0.7} barStyle={{ backgroundColor: '#ff6600' }} /> </View> </Page> ); } }; const styles = { line: { marginTop: 30, height: 100 }, progress: { width: 750, height: 10 } }; render(<App />); ```