(component): 更新日志

This commit is contained in:
就眠儀式 2022-09-27 11:40:29 +08:00
parent 0e8a649fa2
commit 568b8f6131
4 changed files with 193 additions and 172 deletions

View File

@ -1,3 +1,8 @@
@import "../checkbox/index.less";
@import "../input/index.less";
@import "../dropdown/index.less";
@import "../tagInput/index.less";
.layui-select {
width: 220px;

View File

@ -29,10 +29,14 @@ export interface LaySelectProps {
create?: boolean;
disabled?: boolean;
placeholder?: string;
showEmpty?: boolean;
emptyMessage?: string;
modelValue?: any;
multiple?: boolean;
items?: LaySelectOptionProps[];
size?: "lg" | "md" | "sm" | "xs";
collapseTagsTooltip?: boolean;
minCollapsedNum?: number;
allowClear?: boolean;
}
@ -44,6 +48,10 @@ export interface SelectEmits {
const props = withDefaults(defineProps<LaySelectProps>(), {
modelValue: null,
placeholder: "请选择",
showEmpty: true,
emptyMessage: "请选择",
collapseTagsTooltip: true,
minCollapsedNum: 3,
disabled: false,
multiple: false,
create: false,
@ -72,8 +80,12 @@ onMounted(() => {
() => {
if (multiple.value) {
multipleValue.value = selectedValue.value.map((value: any) => {
   return options.value.find((item: any) => item.value === value)
})
return options.value.find((item: any) => {
item.disabled == "" || item.disabled == true ? item.closable = false : item.closable = true;
return item.value === value;
});
});
} else {
singleValue.value = options.value.find((item: any) => {
return item.value === selectedValue.value;
@ -128,6 +140,8 @@ provide("multiple", multiple);
v-if="multiple"
v-model="multipleValue"
:allow-clear="allowClear"
:collapseTagsTooltip="collapseTagsTooltip"
:minCollapsedNum="minCollapsedNum"
:disabledInput="true"
>
<template #suffix>
@ -161,6 +175,7 @@ provide("multiple", multiple);
size="sm"
></lay-input>
</div>
<lay-select-option v-if="showEmpty && !multiple" :label="emptyMessage" value=""></lay-select-option>
<template v-if="items">
<lay-select-option
v-for="(item, index) in items"

View File

@ -14,7 +14,6 @@ import {
Ref,
onMounted,
} from "vue";
import { arrayExpression } from "@babel/types";
export interface LaySelectOptionProps {
label: string;

View File

@ -19,6 +19,8 @@
<li>[新增] tag-input 标签输入框组件, 用于录入事物的属性与纬度。</li>
<li>[新增] table 组件 header 插槽, 用于在工具栏与表格之间插入元素。</li>
<li>[新增] tabitem 组件 icon 属性, 提供 title 属性前置 icon 设置。</li>
<li>[新增] select 组件 collapseTagsTooltip 属性, 多选模式下是否悬浮显示折叠的选中项。</li>
<li>[新增] select 组件 minCollapsedNum 属性, 多选模式选中项超过多少时折叠。</li>
<li>[修复] tolltip 组件 content 变化时, 位置无法自动计算调整的问题。</li>
<li>[修复] breadcrumb-item 组件无法正确传递 attrs, 导致 @click 等自定义事件失效。</li>
<li>[修复] layout 组件仅引入了 footer 作为内容元素时, layui-layout-vertical 样式不生效, 导致布局错误。</li>