<template>
  <el-select clearable :value="value" @change="handleChange" clearable placeholder="请选择产品">
    <el-option
        v-for="item in list"
        :key="item.appName"
        :label="item.appNameStr"
        :value="item.appName"></el-option>
  </el-select>
</template>

<script type="text/ecmascript-6">
  export default {
    name: 'ProductSelect',
    props: {
      value: {
        type: String,
        required: false
      }
    },
    data() {
      return {
        list:[]
      }
    },
   async created() {
     const res = await this.$$get('/back/selectAPPNameList');
     if(res.status===200 && res.data.success){
       this.list = res.data.result;
     }
    },
    methods: {
      handleChange(e){
        this.$emit('handleSetting',e)
      }
    }
  }
</script>
