el-select-4
v1.0.0
Published
这个组件是对el-select组件的增强,为el-select组件增加了属性dict。
Downloads
30
Readme
这个组件是对el-select组件的增强,为el-select组件增加了属性dict。
当el-option不包含el-select的value时,会根据dict显示label。
This component is an enhancement to the el-select component, adding the attribute dict to the el-select component.
When el-option does not contain the value of el-select, label will be displayed according to dict.
<script setup>
import { ref } from 'vue'
const val = ref('')
const dict1 = [
{label:'option 1',value:1}
]
const dict2 = [
{label:'option 1',value:1},
{label:'option 2',value:2},
]
</script>
<template>
<ElSelect4 v-model="val" :dict="dict2">
<ElOption
v-for="item in dict1"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</ElSelect4>
<el-button @click="val=2">2</el-button>
</template>