UNPKG

weex-nuke

Version:

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

70 lines (63 loc) 1.66 kB
# Input Demo * order: 4 * hide :true material design --- ```js /** @jsx createElement */ import { View, Text, Page, Slip, Button, Env, ThemeProvider } from 'weex-nuke'; const { appInfo } = Env; const { StyleProvider } = ThemeProvider; import { createElement, Component, render } from 'rax'; const isAndroid = appInfo.platform.toLowerCase() === 'android'; let md = { Core: { [`color-brand1-1`]: '#00BBD3', [`color-brand1-6`]: isAndroid ? '#1A9CB7' : '#DCDEE3', [`color-brand1-9`]: '#0096A6', [`color-error-3`]: '#D50000' } }; let App = class NukeDemoIndex extends Component { constructor() { super(); this.state = { status: 'error' }; this.slipFromLeft = this.slipFromLeft.bind(this); this.slipFromRight = this.slipFromRight.bind(this); } slipFromLeft() { this.refs.slip1.wrappedInstance.show(); } slipFromRight() { this.refs.slip2.wrappedInstance.show(); } render() { return ( <StyleProvider style={md} androidConfigs={{ materialDesign: isAndroid }}> <Page title="md 风格"> <View style={{ height: 2000, backgroundColor: '#ff6600' }}> <Button style={styles.btn} block type="secondary" onPress={this.slipFromLeft} > 左侧弹出一个面板 </Button> </View> <View style={{ height: 200, backgroundColor: '#3089dc' }} /> <Slip ref="slip1" direction="left" width={400} maskClosable={true} /> </Page> </StyleProvider> ); } }; const styles = { btn: { marginBottom: 20 } }; render(<App />); ```