<template>
  <div>
    <el-select v-model="selectVal" style="width: 100%;" placeholder="请选择学期" :clearable="clearable" :filterable="filterable" @change="change">
      <el-option v-for="item in constants.SEMESTER_LIST" :key="item.value" :label="item.label" :value="item.value" />
    </el-select>
  </div>
</template>

<script>
export default {
  name: 'SelectSemester',
  props: {
    value: {
      type: String,
      default: ''
    },
    clearable: {
      type: Boolean,
      default: false
    },
    filterable: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
    }
  },
  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>
