<template>
  <div>
    <group title="default">
      <radio
        :options="radio001"
        @on-change="change"
      />
    </group>

    <group title="preselect 'China'">
      <radio
        v-model="radio001Value"
        :options="radio001"
      />
    </group>

    <group :title="'fill mode value is '+radio001Value">
      <radio
        v-model="radio001Value"
        fill-mode
        :options="radio001"
        @on-change="change"
      />
    </group>

    <group title="fill mode with custom placeholder and label">
      <radio
        fill-mode
        fill-label="Other"
        fill-placeholder="填写其他的哦"
        :options="radio001"
        @on-change="change"
      />
    </group>

    <group title="object options">
      <radio
        fill-mode
        fill-label="Other"
        fill-placeholder="other"
        :options="radio003"
        @on-change="change"
      />
    </group>
  </div>
</template>

<script>
import { Radio, Group } from '../components/_index'

export default {
  components: {
    Radio,
    Group
  },
  data () {
    return {
      radio001: [ 'China', 'Japan' ],
      radio001Value: 1,
      radio002Value: 'Japan',
      radio003: [{
        key: '001',
        value: 'radio001'
      }, {
        key: '002',
        value: 'radio002'
      }]
    }
  },
  methods: {
    change (value) {
      console.log('change:', value)
    }
  }
}
</script>
