mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 01:11:25 +08:00
48 lines
875 B
Vue
48 lines
875 B
Vue
|
<template>
|
||
|
<el-select v-model="value" placeholder="Select">
|
||
|
<el-option
|
||
|
v-for="item in options"
|
||
|
:key="item.value"
|
||
|
:label="item.label"
|
||
|
:value="item.value"
|
||
|
:disabled="item.disabled"
|
||
|
>
|
||
|
</el-option>
|
||
|
</el-select>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import { ref, defineComponent } from 'vue'
|
||
|
|
||
|
export default defineComponent({
|
||
|
setup() {
|
||
|
return {
|
||
|
options: ref([
|
||
|
{
|
||
|
value: 'Option1',
|
||
|
label: 'Option1',
|
||
|
},
|
||
|
{
|
||
|
value: 'Option2',
|
||
|
label: 'Option2',
|
||
|
disabled: true,
|
||
|
},
|
||
|
{
|
||
|
value: 'Option3',
|
||
|
label: 'Option3',
|
||
|
},
|
||
|
{
|
||
|
value: 'Option4',
|
||
|
label: 'Option4',
|
||
|
},
|
||
|
{
|
||
|
value: 'Option5',
|
||
|
label: 'Option5',
|
||
|
},
|
||
|
]),
|
||
|
value: ref(''),
|
||
|
}
|
||
|
},
|
||
|
})
|
||
|
</script>
|