(component): 新增 select 组件 searchPlaceholder 属性

This commit is contained in:
就眠儀式 2022-09-28 11:04:45 +08:00
parent 2a898b4ff9
commit 15c95a90f2
3 changed files with 8 additions and 5 deletions

View File

@ -135,7 +135,11 @@ const showPassword = () => {
</script>
<template>
<div class="layui-input" :class="{'layui-input-has-prefix': slots.prefix || props.prefixIcon}" :size="size">
<div
class="layui-input"
:class="{ 'layui-input-has-prefix': slots.prefix || props.prefixIcon }"
:size="size"
>
<div class="layui-input-prepend" v-if="slots.prepend">
<slot name="prepend"></slot>
</div>

View File

@ -54,7 +54,4 @@
.layui-select-search {
padding: 5px 10px;
.layui-input-prefix {
padding: 0 0 0 10px;
}
}

View File

@ -28,6 +28,7 @@ export interface LaySelectProps {
name?: string;
disabled?: boolean;
placeholder?: string;
searchPlaceholder?: string;
showEmpty?: boolean;
emptyMessage?: string;
modelValue?: any;
@ -50,6 +51,7 @@ const props = withDefaults(defineProps<LaySelectProps>(), {
placeholder: "请选择",
showEmpty: true,
emptyMessage: "请选择",
searchPlaceholder: "请输入",
collapseTagsTooltip: true,
minCollapsedNum: 3,
disabled: false,
@ -188,8 +190,8 @@ provide("multiple", multiple);
<div class="layui-select-search" v-if="multiple && showSearch">
<lay-input
v-model="searchValue"
:placeholder="searchPlaceholder"
prefix-icon="layui-icon-search"
placeholder="请搜索"
size="sm"
></lay-input>
</div>