feat(IconPicker): IconPicker could allowClear and readonly for form (#3414)

This commit is contained in:
xachary 2023-12-14 09:26:34 +08:00 committed by GitHub
parent 595b1ce680
commit e23f29464b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1,11 +1,12 @@
<template> <template>
<Input <Input
readonly
:style="{ width }" :style="{ width }"
:placeholder="t('component.icon.placeholder')" :placeholder="t('component.icon.placeholder')"
:class="prefixCls" :class="prefixCls"
v-model:value="currentSelect" v-model:value="currentSelect"
@click="triggerPopover" @click="triggerPopover"
:allowClear="props.allowClear"
:readonly="props.readonly"
> >
<template #addonAfter> <template #addonAfter>
<Popover <Popover
@ -103,6 +104,8 @@
pageSize?: number; pageSize?: number;
copy?: boolean; copy?: boolean;
mode?: 'svg' | 'iconify'; mode?: 'svg' | 'iconify';
allowClear?: boolean;
readonly?: boolean;
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
@ -111,6 +114,8 @@
pageSize: 140, pageSize: 140,
copy: false, copy: false,
mode: 'iconify', mode: 'iconify',
allowClear: true,
readonly: false,
}); });
// Don't inherit FormItem disabledplaceholder... // Don't inherit FormItem disabledplaceholder...