<template>
  <div>
    <el-select v-model="selectVal" style="width: 100%;" placeholder="请选择课程类型" :clearable="clearable" :filterable="filterable" @change="change">
      <el-option v-for="item in courseType" :key="item.value" :label="item.label" :value="item.value" />
    </el-select>
  </div>
</template>

<script>
export default {
  name: 'SelectCourseType',
  props: {
    value: {
      type: String,
      default: ''
    },
    clearable: {
      type: Boolean,
      default: false
    },
    filterable: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      courseType: [{
        value: '德育',
        label: '德育'
      }, {
        value: '智育',
        label: '智育'
      }, {
        value: '体育',
        label: '体育'
      }, {
        value: '美育',
        label: '美育'
      }, {
        value: '劳育',
        label: '劳育'
      }]
    }
  },
  computed: {
    selectVal: {
      get() {
        return this.value
      },
      set(newValue) {
        this.$emit('input', newValue)
      }
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
    },
    change(newValue) {
      this.$emit('change', newValue)
    }
  }
}
</script>

<style scoped>
</style>
