预览 二维码

/** @jsx createElement */
import {createElement, Component} from 'weex-rx';
import { View, Text} from 'nuke-components';
import { Button, Modal, ActionSheet } from 'nuke';
import {mount} from 'nuke-mounter';


let App = class NukeDemoIndex extends Component {
    constructor() {
        super(); 
    }

    press() {
        ActionSheet.show({
            options: ['拨打电话','发送短信','删除订单','取消'],
            cancelButtonIndex: 3,
            destructiveButtonIndex: 2,
            title:'ActionSheet Title'
        }, (ret) => {
            //{ type : "button",buttonIndex : 1/2/3 }

            //{ type : "destructive"}
            console.log(JSON.stringify(ret));
        }, (cancel) => {
            //{ type : "cancel"}
            console.log(JSON.stringify(cancel));
        });
    }

    render() {
        return (
            <View>

                <View>
                    <Button onPress={this.press.bind(this)} block="true" type="primary">点我</Button>
                </View>
            </View>

        );
    }
}

mount(<App/>, mountNode);

普通按钮。