(component): 新增 date-picker 组件 prefix-icon 与 suffix-icon 选项

This commit is contained in:
就眠儀式 2022-08-12 15:21:38 +08:00
parent 820b956871
commit 73d3bf90de

View File

@ -14,7 +14,8 @@
:readonly="readonly" :readonly="readonly"
v-model="dateValue" v-model="dateValue"
:placeholder="placeholder" :placeholder="placeholder"
prefix-icon="layui-icon-date" :prefix-icon="prefixIcon"
:suffix-icon="suffixIcon"
:disabled="disabled" :disabled="disabled"
v-if="!range" v-if="!range"
@change="onChange" @change="onChange"
@ -130,6 +131,8 @@ export interface LayDatePickerProps {
readonly?: boolean; readonly?: boolean;
allowClear?: boolean; allowClear?: boolean;
size?: "lg" | "md" | "sm" | "xs"; size?: "lg" | "md" | "sm" | "xs";
prefixIcon?: string;
suffixIcon?: string;
} }
const props = withDefaults(defineProps<LayDatePickerProps>(), { const props = withDefaults(defineProps<LayDatePickerProps>(), {
@ -142,6 +145,8 @@ const props = withDefaults(defineProps<LayDatePickerProps>(), {
readonly: false, readonly: false,
allowClear: false, allowClear: false,
size: "md", size: "md",
prefixIcon: "layui-icon-date",
suffixIcon: ""
}); });
const dropdownRef = ref(null); const dropdownRef = ref(null);