🐛(component): 修复 select 组件 allow-clear 属性为非必填

This commit is contained in:
就眠儀式 2022-07-28 17:50:09 +08:00
parent 4ced58ca35
commit 19b1dd5c88
3 changed files with 4 additions and 3 deletions

View File

@ -31,7 +31,7 @@ export interface LaySelectProps {
keyword: string; keyword: string;
}[]; }[];
size?: "lg" | "md" | "sm" | "xs"; size?: "lg" | "md" | "sm" | "xs";
allowClear: boolean; allowClear?: boolean;
} }
const selectRef = shallowRef<undefined | HTMLElement>(undefined); const selectRef = shallowRef<undefined | HTMLElement>(undefined);

View File

@ -42,9 +42,10 @@
.layui-textarea::-webkit-input-placeholder { .layui-textarea::-webkit-input-placeholder {
line-height: 1.3; line-height: 1.3;
} }
.layui-texterea-show-count { .layui-texterea-count {
text-align: right; text-align: right;
color: inherit; color: inherit;
white-space: nowrap; white-space: nowrap;
pointer-events: none; pointer-events: none;
margin-top: 4px;
} }

View File

@ -84,7 +84,7 @@ const wordCount = computed(() => {
<span class="layui-textarea-clear" v-if="allowClear && hasContent"> <span class="layui-textarea-clear" v-if="allowClear && hasContent">
<lay-icon type="layui-icon-close-fill" @click="onClear"></lay-icon> <lay-icon type="layui-icon-close-fill" @click="onClear"></lay-icon>
</span> </span>
<div v-if="showCount" class="layui-texterea-show-count"> <div v-if="showCount" class="layui-texterea-count">
{{ wordCount }} {{ wordCount }}
</div> </div>
</div> </div>