<template>
     <Select v-model="sels"  :multiple="isMultiple">
        <Option v-for="item in ops" :value="item.value" :key="item.value">{{ item.label }}</Option>
    </Select>
</template>
<script>
import { refQuery } from '@/api/meta'
export default {
  name: "Selects",
  props: ['value','isMultiple'],
  model:{
    prop: 'value',
    event: 'change'
 },
  data() {
    return {
       ops:[],
       sels:''
    };
  },
  created() {
     console.log("cccccccccccccccccc")
     refQuery(null,"city").then(res=>{
        console.log("................................................")
        this.ops=res.data;
        this.sels=this.value;
     });
  },
  mounted(){
        console.log("cccccccccccccccccc")
  },
  watch: {
    value(nv,ov){
      console.log("...value.....");
       this.sels=nv;
    },
    sels(nv,ov){
      console.log("...change.....");
      this.$emit("change",this.sels);
    }
  },
  computed: {},
  methods: {}
};
</script>
