AIoT前端公共UI

Select.vue 938B

    <!-- eslint-disable vue/no-mutating-props --> <!-- * @Author: Devin * @Date: 2022-11-16 14:26:49 * @LastEditors: Devin * @LastEditTime: 2023-02-22 14:51:10 * @Description: 下拉框事件 --> <template> <el-select class="ipu-select"> <el-option v-for="item in options" :key="item[propsMap.value]" :disabled="item?.['disabled']" :label="item[propsMap.label]" :value="item[propsMap.value]" ></el-option> </el-select> </template> <script lang="ts" setup> interface optiosnType { value: any; label: any; } defineProps({ options: { type: Array<optiosnType>, default: () => [] }, propsMap: { type: Object, default: () => { return { value: 'value', label: 'label' }; } } }); </script> <script lang="ts"> export default { name: 'CommonSelect' }; </script> <style lang="scss"> .ipu-select { width: 100%; display: block; } </style>