1. var component = new NEKUI.Component({
    template: template,
    data: {
    source: [
    {name: '选项1'},
    {name: '选项2'},
    {name: '选项3'},
    {name: '选项4'},
    {name: '选项5'},
    {name: '选项6'}
    ]
    }
    });

数据绑定

单选组 radio.group - 图2

  1. <radio.group source={source} value={value} selected={selected} />
    <div>value: {value}</div>
    <div>selected: {selected ? JSON.stringify(selected) : ''}</div>
  1. var component = new NEKUI.Component({
    template: template,
    data: {
    source: [
    {id: 11, name: '选项1'},
    {id: 22, name: '选项2'},
    {id: 33, name: '选项3'},
    ]
    }
    });

在表单中使用

  1. var component = new NEKUI.Component({
    template: template,
    data: {
    source: [
    {name: '选项1'},
    {name: '选项2'},
    {name: '选项3'},
    {name: '选项4'},
    {name: '选项5'},
    {name: '选项6'}
    ]
    }
    });

禁用组件

  1. <radio.group source={source} disabled />
  1. var component = new NEKUI.Component({
    template: template,
    data: {
    source: [
    {name: '选项1'},
    {name: '选项2'},
    {name: '选项3'},
    {name: '选项4'},
    {name: '选项5'},
    {name: '选项6'}
    ]
    }
    });

单选组 radio.group - 图5

  1. var component = new NEKUI.Component({
    template: template,
    service: {
    getList: function(params, success) {
    NEKUI.ajax.request({
    url: '../data/list.json',
    method: 'get',
    type: 'json',
    data: params,
    success: success
    });
    }
    }
    });

多行

    1. var component = new NEKUI.Component({
      template: template,
      data: {
      source: [
      {name: '选项1'},
      {name: '选项2'},
      {name: '选项3'},
      {name: '选项4'},
      {name: '选项5'},
      {name: '选项6'}
      ]
      }
      });

    API

    Classes

    Events

    RadioGroup

    Kind: global classExtend: SourceComponent

    Kind: global functionAccess: protected

    select(item) 选择某一(item) ⇒ void

    Kind: global functionAccess: public

    validate() 根据required验证组件的值是否正确() ⇒ object

    Kind: event emittedProperties