You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
887 B

3 years ago
<template>
<el-select
:value="value"
:placeholder="placeholder"
:multiple="multiple"
clearable
filterable
style="width:100%;"
@change="$emit('input', $event)"
>
<el-option
v-for="item in dataList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
<script>
export default {
props: {
value: { type: Array, default: () => [] },
multiple: { type: Boolean, default: false },
placeholder: { type: String, default: '请选择' }
},
data() {
return {
dataList: []
}
},
mounted() { this.getDataList() },
methods: {
getDataList(id) {
return this.$http.get('/checkItem/project/getList').then(({ data: res }) => {
if (res.code === 0) { this.dataList = res.data } else { this.$message.error(res.msg) }
}).catch(() => {})
}
}
}
</script>