<template>
  <el-switch v-model="mValue" size="mini" v-bind="$attrs" @change="handleChange"></el-switch>
</template>
<script>
import { Switch } from 'element-ui'

export default {
  components: {
    "ElSwitch": Switch,
  },
  props: ['value'],
  computed: {
    mValue: {
      get () {
        return this.value
      },
      set (val) {
        this.$emit('input', val)
      }
    }
  },
  methods: {
    handleChange (val) {
      this.$emit('change', val)
    }
  }
}
</script>
