<template> <el-select v-model="selectedValue" @change="handleChange" placeholder="请选择"> <el-option v-for="option in options" :key="option.value" :label="option.label" :value="option.value"></el-option> </el-select> </template> <script> export default { name: 'SelectComponent', props: { options: { type: Array, required: true }, value: { type: [String, Number], default: '' } }, data() { return { selectedValue: this.value } }, watch: { value(newValue) { this.selectedValue = newValue }, selectedValue(newVal) { this.$emit('input', newVal) } }, methods: { handleChange(value) { this.$emit('change', value) } } }; </script> <style scoped> /* 你可以在这里添加样式 */ </style>