mirror of
https://github.com/element-plus/element-plus.git
synced 2025-08-15 11:34:06 +08:00

* fix(components): [el-select] optimize prefix size & selected style * fix: implement icon by mask * chore: adjust multiple demo width
62 lines
975 B
Vue
62 lines
975 B
Vue
<template>
|
|
<el-select
|
|
v-model="value1"
|
|
multiple
|
|
placeholder="Select"
|
|
style="width: 240px"
|
|
>
|
|
<el-option
|
|
v-for="item in options"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
|
|
<el-select
|
|
v-model="value2"
|
|
multiple
|
|
collapse-tags
|
|
style="margin-left: 20px; width: 240px"
|
|
placeholder="Select"
|
|
>
|
|
<el-option
|
|
v-for="item in options"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref } from 'vue'
|
|
|
|
const value1 = ref([])
|
|
const value2 = ref([])
|
|
const options = [
|
|
{
|
|
value: 'Option1',
|
|
label: 'Option1',
|
|
},
|
|
{
|
|
value: 'Option2',
|
|
label: 'Option2',
|
|
},
|
|
{
|
|
value: 'Option3',
|
|
label: 'Option3',
|
|
},
|
|
{
|
|
value: 'Option4',
|
|
label: 'Option4',
|
|
},
|
|
{
|
|
value: 'Option5',
|
|
label: 'Option5',
|
|
},
|
|
]
|
|
</script>
|