zmc
2023-08-14 172d73cbe737c04b3d2c3fe8908db2460c241543
src/sfc/ShopNameAndID.vue
@@ -5,14 +5,16 @@
import axiosInstanceInstance from '../utils/request.js'
export default {
  // 默认选择一个
  // props:{
  //   devId:{
  //     type: Array,
  //     default: ['全部','全部'],
  //   }
  props:{
    devId:{
      type: Array,
      default(){
        return ['全部','全部']
      }
    }
     
  // }
  props:['devId'],
  },
  // props:['devId'],
  emits: ['submitId'],
  data() {
    return {
@@ -55,7 +57,15 @@
        
        // 打开时默认展示一个店铺
      this.deviceId = this.devId
    }
    },
    changeDev(){
      if(this.deviceId == null){
        this.deviceId = ['','']
        this.$emit('submitId', this.deviceId[1])
      }else{
      this.$emit('submitId', this.deviceId[1])
      }
    },
  }
};
</script>
@@ -67,11 +77,11 @@
        v-model="deviceId"
        :options="optionsShop"
        :props="{ expandTrigger: 'hover' }"
        @change="$emit('submitId', deviceId[1])"
        @change="changeDev"
        placeholder="全部"
        clearable
      />
      <!--   @visible-change="getDeviceInfo" -->
      <!--   @change="$emit('submitId', deviceId[1])"  @change="changeDev"-->
    </span>
  </div>
</template>