currency-select.vue 835 Bytes
Newer Older
邓春圆's avatar
邓春圆 committed
1 2
<template>
 <div style="width: 100%;min-width: 100px">
3
  <el-select @change="(e) =>{$emit('change', e)}" :disabled="disabled" v-model="val">
邓春圆's avatar
邓春圆 committed
4 5 6 7 8 9 10 11 12
    <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:{
13 14 15 16
     disabled:{
       type:Boolean,
       default:false
     },
邓春圆's avatar
邓春圆 committed
17 18 19 20 21 22
    options:{
      type:Array,
      default:()=>[]
    },
     value:{
      type: [Number,String],
邓春圆's avatar
邓春圆 committed
23
       default:undefined,
邓春圆's avatar
邓春圆 committed
24 25 26 27 28 29 30
     }
   },
  data(){
    return{
      val:''
    }
  },
邓春圆's avatar
邓春圆 committed
31
  created() {
邓春圆's avatar
邓春圆 committed
32
    this.val = this.value;
邓春圆's avatar
邓春圆 committed
33
  },
邓春圆's avatar
邓春圆 committed
34 35 36
  watch:{
    val(){
      this.$emit('input',this.val)
邓春圆's avatar
邓春圆 committed
37 38 39 40
    },
    value(val){
      console.log(val,'valllll')
      this.val = val;
邓春圆's avatar
邓春圆 committed
41 42 43 44 45 46 47 48
    }
  }
}
</script>

<style scoped>

</style>