mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-06-19 23:02:00 +08:00
!522 fix: Fixed the clearable invalid issue of IconSelect component for MenuForm page
Merge pull request !522 from AhJindeg/hotfix/IconSelect
This commit is contained in:
commit
5bf1de5481
@ -11,6 +11,10 @@ const props = defineProps({
|
|||||||
modelValue: {
|
modelValue: {
|
||||||
require: false,
|
require: false,
|
||||||
type: String
|
type: String
|
||||||
|
},
|
||||||
|
clearable: {
|
||||||
|
require: false,
|
||||||
|
type: Boolean
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const emit = defineEmits<{ (e: 'update:modelValue', v: string) }>()
|
const emit = defineEmits<{ (e: 'update:modelValue', v: string) }>()
|
||||||
@ -92,6 +96,12 @@ function onCurrentChange(page) {
|
|||||||
currentPage.value = page
|
currentPage.value = page
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearIcon() {
|
||||||
|
icon.value = ''
|
||||||
|
emit('update:modelValue', '')
|
||||||
|
visible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => {
|
() => {
|
||||||
return props.modelValue
|
return props.modelValue
|
||||||
@ -115,7 +125,7 @@ watch(
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="selector">
|
<div class="selector">
|
||||||
<ElInput v-model="inputValue" @click="visible = !visible">
|
<ElInput v-model="inputValue" @click="visible = !visible" :clearable="props.clearable" @clear="clearIcon">
|
||||||
<template #append>
|
<template #append>
|
||||||
<ElPopover
|
<ElPopover
|
||||||
:popper-options="{
|
:popper-options="{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user