<!--站点选择组件-->
<template>
  <div class="zd-select-container">
    <el-form :inline="true">
      <el-form-item label="站点选择">
        <el-select v-model="id" placeholder="请选择换电站名称" :loading="loading" @change="change">
          <el-option label="站点1" value="1"></el-option>
          <el-option label="站点2" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">搜索</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<style scoped lang="scss">

</style>
<script>
//todo 动态获取电站列表 默认值，是否有设置默认值的功能
  export default {
    data() {
      return {
        id:'',
        loading:false
      }
    },
    methods:{
      onSubmit(){
        console.log(this.id)
        this.$emit('submit',this.id)
      },
      change(id){
        console.log('发生变更',id)
        this.$emit('change',id)
      }
    }
  }
</script>
