修复单选组件
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="KuSelect">
|
||||
<el-select clearable :modelValue="modelValue" :filterable="isAction" v-bind="$attrs"
|
||||
@change="v=>$emit('update:modelValue',v)">
|
||||
@change="v=>$emit('update:modelValue',v)" placeholder="请选择">
|
||||
<template v-if="isAction">
|
||||
<el-option v-for="op in actionOps" :key="op.id" :label="op[actionProp.label]" :value="op[actionProp.value]"/>
|
||||
</template>
|
||||
@@ -23,8 +23,10 @@ export default {
|
||||
}
|
||||
},
|
||||
modelValue(v) {
|
||||
this.$emit("select", this.isAction ? this.options.find(e => e[this.actionProp.value] == v) :
|
||||
this.selectList.find(e => e.dictValue == v))
|
||||
this.$emit("select", this.isAction ? this.options.find(e => e[this.actionProp.value] == v) : {
|
||||
name: this.ops[v],
|
||||
value: v
|
||||
})
|
||||
}
|
||||
},
|
||||
props: {
|
||||
@@ -35,7 +37,6 @@ export default {
|
||||
prop: {default: () => ({})},
|
||||
dict: String
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
|
||||
Reference in New Issue
Block a user