wujingjing
2024-07-25 ec939b38e899676e4dc117b1d4f3468da2607777
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<template>
    <el-select class="w-32" v-model="selectValue" @change="changeValue" :disabled="disabled">
        <el-option v-for="item in data.list" :key="item.value" :value="item.value" :label="item.title"></el-option>
    </el-select>
</template>
 
<script setup lang="ts">
import type { PropType } from 'vue';
import type { ListParam } from '../types';
 
const props = defineProps({
    data: {
        type: Object as PropType<ListParam>,
    },
    disabled: {
        type: Boolean,
        default: false,
    },
});
 
const emit = defineEmits(['change']);
 
const selectValue = defineModel({
    type: String,
});
 
const changeValue = (val) => {
    emit('change', val);
};
</script>
<style scoped lang="scss"></style>