mirror of
https://github.com/element-plus/element-plus.git
synced 2025-12-19 09:09:40 +08:00
* docs(components): [select] demo for adjusting the options property * refactor: adjust the position of the props
48 lines
647 B
Vue
48 lines
647 B
Vue
<template>
|
|
<el-select
|
|
v-model="value"
|
|
:options="options"
|
|
:props="props"
|
|
placeholder="Select"
|
|
style="width: 240px"
|
|
/>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref } from 'vue'
|
|
|
|
const value = ref('')
|
|
|
|
const props = {
|
|
value: 'id',
|
|
label: 'label',
|
|
options: 'options',
|
|
disabled: 'disabled',
|
|
}
|
|
|
|
const options = [
|
|
{
|
|
id: 'Option1',
|
|
label: 'Option1',
|
|
},
|
|
{
|
|
id: 'Option2',
|
|
label: 'Option2',
|
|
disabled: true,
|
|
},
|
|
{
|
|
id: 'Option3',
|
|
label: 'Option3',
|
|
},
|
|
{
|
|
id: 'Option4',
|
|
label: 'Option4',
|
|
disabled: true,
|
|
},
|
|
{
|
|
id: 'Option5',
|
|
label: 'Option5',
|
|
},
|
|
]
|
|
</script>
|