预览 二维码

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


let App = class NukeDemoIndex extends Component {
    constructor() {
        super();
        this.state = {
            checked:true
        }
    }

    onChange(value){
        console.log('checked',value);
    } 
    onPress(){
        let tmp = this.state.checked;
        this.setState({
            checked:!tmp
            })
    }

    render() {
        return (
            <View> 
               <Text>受限使用</Text> 
               <Button onPress={this.onPress.bind(this)}>{this.state.checked}</Button>
               <Radio size="small" checked={this.state.checked} onChange={this.onChange}></Radio>
               <Text>非受限使用</Text> 
               <Radio checked={true} onChange={this.onChange}></Radio>
            </View>

        );
    }
}

mount(<App/>, mountNode);

普通单选框。