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 = {
value:1
}
}
onChange(value){
this.setState({
value:value
})
}
press(){
let tmp = this.state.value;
this.setState({
value:++tmp
});
console.log(this.state);
}
render() {
const dataSource = [
{value:1, label: '苹果'},
{value:2, label: '梨'},
{value:3, label: '橘子'}
];
return (
<View>
<Button onPress={this.press.bind(this)}>受限使用+{ this.state.value }</Button>
<Radio.Group value={this.state.value} onChange={ this.onChange.bind(this) } size="small" dataSource={ dataSource }></Radio.Group>
</View>
);
}
}
mount(<App/>, mountNode);