UNPKG

weex-nuke

Version:

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

62 lines (56 loc) 1.24 kB
# 对话框 * order: 2 静态调用图片预览 --- ```js /** @jsx createElement */ import { View, Text, Env, ScrollView, Dialog, Button, Page, Image } from 'weex-nuke'; import { createElement, Component, render } from 'rax'; let App = class NukeDemoIndex extends Component { constructor() { super(); } show = () => { Dialog.show({ content: ( <View style={styles.inner}> <Image src="//gw.alicdn.com/tfs/TB1LPQYi5qAXuNjy1XdXXaYcVXa-1100-1100.png" style={{ flex: 1 }} resizeMode="contain" /> <Button onPress={this.onPress}>设为主图</Button> </View> ), contentStyle: styles.container, style: styles.wrapper, }); }; render() { return ( <Page title="Dialog Static"> <Page.Intro main="show" /> <Button style={styles.btn} type="primary" onPress={this.show}> 图片预览 </Button> </Page> ); } }; var styles = { wrapper: { backgroundColor: '#000000', flex: 1, }, container: { width: 750, height: 1000, backgroundColor: 'transparent', }, inner: { flex: 1, backgroundColor: 'transparent', }, }; render(<App />); ```