Newer
Older
CloudBrainNew / src / components / radioGroup / index1.vue
[wangxitong] on 4 Jun 2021 973 bytes 0604 submit
<!--
 * @Description: 选择tab
 * @Author: 王晓颖
 * @Date:
 -->
<template>
  <div style="position: absolute;right:10px;top:-30px;">
    <el-radio-group size="mini" v-model="input">
      <el-radio-button v-for="item of group" :key="'radio'+item.value" :label="item.value">{{item.label}}</el-radio-button>
    </el-radio-group>
  </div>
</template>

<script>
export default {
  name: 'RadioGroup',
  props: {
    value: {
      type: String,
      required: true
    },
    group: {
      type: Array,
      default: () => {
        return [
          {label: '本周', value: 'week'},
          {label: '本月', value: 'month'}
        ]
      }
    }
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  computed: {
    input: {
      get () {
        return this.value
      },
      set (val) {
        console.log('changeSelect')
        this.$emit('change', val)
      }
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>

</style>