currency-select.vue 711 Bytes
Newer Older
邓春圆's avatar
邓春圆 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<template>
 <div style="width: 100%;min-width: 100px">
  <el-select v-model="val">
    <el-option :value="item.id" :label="$l(item, 'title') + item.fuhao"  v-for="(item)  in options"></el-option>
  </el-select>
 </div>
</template>

<script>
export default {
  name: "currency-select",
   props:{
    options:{
      type:Array,
      default:()=>[]
    },
     value:{
      type: [Number,String],
邓春圆's avatar
邓春圆 committed
19
       default:undefined,
邓春圆's avatar
邓春圆 committed
20 21 22 23 24 25 26
     }
   },
  data(){
    return{
      val:''
    }
  },
邓春圆's avatar
邓春圆 committed
27
  created() {
邓春圆's avatar
邓春圆 committed
28
    this.val = this.value;
邓春圆's avatar
邓春圆 committed
29
  },
邓春圆's avatar
邓春圆 committed
30 31 32
  watch:{
    val(){
      this.$emit('input',this.val)
邓春圆's avatar
邓春圆 committed
33 34 35 36
    },
    value(val){
      console.log(val,'valllll')
      this.val = val;
邓春圆's avatar
邓春圆 committed
37 38 39 40 41 42 43 44
    }
  }
}
</script>

<style scoped>

</style>