<template>
  <el-select filterable :value="value === 0 ? undefined : value" @change="change" v-bind="$attrs" clearable>
    <el-option v-for="user in getUser" :key="user.id" :value="user.id" :label="user.nickname"></el-option>
  </el-select>
</template>

<script>
/**
 * 用户
 */
export default {
  name: "userSelect",
  inheritAttrs: false,
  props: {
    value: Number | Array,
    allUsers: Array,
  },
  model: {
    prop: "value",
    event: "change",
  },
  data() {
    return {};
  },
  computed: {
    getUser() {
      return this.allUsers;
    },
  },
  methods: {
    change(val) {
      this.$emit("change", val);
    },
  },
};
</script>
