(component): 发布 1.6.9 版本

This commit is contained in:
就眠儀式 2022-10-19 00:01:09 +08:00
parent b50aa5f1fe
commit 96a3ef9180
7 changed files with 36 additions and 55 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@layui/layui-vue", "name": "@layui/layui-vue",
"version": "1.6.9-alpha.3", "version": "1.6.9",
"author": "就眠儀式", "author": "就眠儀式",
"license": "MIT", "license": "MIT",
"description": "a component library for Vue 3 base on layui-vue", "description": "a component library for Vue 3 base on layui-vue",

View File

@ -16,17 +16,13 @@ import {
VNode, VNode,
Component, Component,
watch, watch,
nextTick,
onUnmounted, onUnmounted,
h,
} from "vue"; } from "vue";
import { LayIcon } from "@layui/icons-vue"; import { LayIcon } from "@layui/icons-vue";
import LayInput from "../input/index.vue"; import LayInput from "../input/index.vue";
import LayTagInput from "../tagInput/index.vue"; import LayTagInput from "../tagInput/index.vue";
import LayDropdown from "../dropdown/index.vue"; import LayDropdown from "../dropdown/index.vue";
import LaySelectOption, { import LaySelectOption, { SelectOptionProps } from "../selectOption/index.vue";
LaySelectOptionProps,
} from "../selectOption/index.vue";
import { SelectSize } from "./interface"; import { SelectSize } from "./interface";
export interface SelectProps { export interface SelectProps {
@ -38,7 +34,7 @@ export interface SelectProps {
emptyMessage?: string; emptyMessage?: string;
modelValue?: any; modelValue?: any;
multiple?: boolean; multiple?: boolean;
items?: LaySelectOptionProps[]; items?: SelectOptionProps[];
size?: SelectSize; size?: SelectSize;
collapseTagsTooltip?: boolean; collapseTagsTooltip?: boolean;
minCollapsedNum?: number; minCollapsedNum?: number;
@ -77,30 +73,34 @@ const openState: Ref<boolean> = ref(false);
const options = ref<any>([]); const options = ref<any>([]);
var timer: any; var timer: any;
const getOption = (nodes: VNode[]) => { const getOption = (nodes: VNode[], newOptions: any[]) => {
nodes const showNodes = nodes?.filter((item: VNode) => {
?.filter((item: VNode) => { return item.children != "v-if";
return item.children != "v-if"; });
})
?.map((item: VNode) => { showNodes?.map((item: VNode) => {
let component = item.type as Component; let component = item.type as Component;
if (component.name === LaySelectOption.name) { if (component.name === LaySelectOption.name) {
if (item.children) { if (item.children) {
// @ts-ignore // @ts-ignore
item.props.label = item.children.default()[0].children; item.props.label = item.children.default()[0].children;
}
options.value.push(item.props);
} else {
getOption(item.children as VNode[]);
} }
}); newOptions.push(item.props);
} else {
getOption(item.children as VNode[], newOptions);
}
});
}; };
const intOption = () => { const intOption = () => {
const newOptions: any[] = [];
if (slots.default) { if (slots.default) {
getOption(slots.default()); getOption(slots.default(), newOptions);
}
Object.assign(newOptions, props.items);
if (JSON.stringify(newOptions) != JSON.stringify(options.value)) {
options.value = newOptions;
} }
Object.assign(options.value, props.items);
}; };
const handleRemove = (value: any) => { const handleRemove = (value: any) => {
@ -248,4 +248,4 @@ provide("multiple", multiple);
</template> </template>
</lay-dropdown> </lay-dropdown>
</div> </div>
</template> </template>

View File

@ -61,7 +61,6 @@ import LayDropdownSubMenu from "./component/dropdownSubMenu/index";
import LayTab from "./component/tab/index"; import LayTab from "./component/tab/index";
import LayTabItem from "./component/tabItem/index"; import LayTabItem from "./component/tabItem/index";
import LayTree from "./component/tree/index"; import LayTree from "./component/tree/index";
import LayTreeSelect from "./component/treeSelect/index";
import LayTable from "./component/table/index"; import LayTable from "./component/table/index";
import LayPage from "./component/page/index"; import LayPage from "./component/page/index";
import LayTransfer from "./component/transfer/index"; import LayTransfer from "./component/transfer/index";
@ -181,7 +180,6 @@ const components: Record<string, Plugin> = {
LaySpace, LaySpace,
LayTag, LayTag,
LayTagInput, LayTagInput,
LayTreeSelect,
}; };
const install = (app: App, options?: InstallOptions): void => { const install = (app: App, options?: InstallOptions): void => {
@ -278,7 +276,6 @@ export {
LaySpace, LaySpace,
LayTag, LayTag,
LayTagInput, LayTagInput,
LayTreeSelect,
install, install,
}; };

View File

@ -214,7 +214,7 @@ export default {
::: demo ::: demo
<template> <template>
<lay-button @click="mvalue=[1,5,7]">点击切换(当前值:{{mvalue.join()}})</lay-button> <lay-button @click="mvalue=['1','5','7']">点击切换(当前值:{{mvalue.join()}})</lay-button>
<br/> <br/>
<br/> <br/>
<lay-select v-model="mvalue" @change="change" multiple> <lay-select v-model="mvalue" @change="change" multiple>

View File

@ -5,35 +5,25 @@
<lay-timeline-item title="🐛 尾版本号:日常问题更新。" simple></lay-timeline-item> <lay-timeline-item title="🐛 尾版本号:日常问题更新。" simple></lay-timeline-item>
<lay-timeline-item title="🌟 次版本号:带有新特性的向下兼容的版本。" simple></lay-timeline-item> <lay-timeline-item title="🌟 次版本号:带有新特性的向下兼容的版本。" simple></lay-timeline-item>
<lay-timeline-item title="♻️ 主版本号:含有破坏性更新和新特性,不在发布周期内。" simple></lay-timeline-item> <lay-timeline-item title="♻️ 主版本号:含有破坏性更新和新特性,不在发布周期内。" simple></lay-timeline-item>
<lay-timeline-item title="♻️ 其他说明:含有破坏性更新和新特性,不在发布周期内。" simple></lay-timeline-item>
</lay-timeline> </lay-timeline>
::: demo ::: demo
<template> <template>
<lay-timeline> <lay-timeline>
<lay-timeline-item title="1.7.x"> <lay-timeline-item title="1.6.x">
<ul> <ul>
<a name="1-7-0"></a> <a name="1-6-9"></a>
<li> <li>
<h3>1.7.0 <span class="layui-badge-rim">2022-10-15</span></h3> <h3>1.6.9 <span class="layui-badge-rim">2022-10-18</span></h3>
<ul> <ul>
<li> <li>[修复] select 组件内部维护 options 时导致的内存溢出问题。</li>
<li>table 组件</li> <li>[修复] select 组件单选模式 showSearch 属性开启时, 输入框循环重置的问题。</li>
<ul> <li>[修复] upload 组件 drag 为 true 时, 获取拖拽文件 files 集合失败, 无法正常上传。</li>
<li>[新增] ** 属性。</li> <li>[优化] layer 组件 id 属性, 当值相同时仅保留最新的弹出层实例。</li>
<li>[新增] ** 方法。</li>
</ul>
</li>
<li>[新增] tree-select 下拉树组件, 提供树结构数据选择能力。</li>
<li>[修复] upload 组件 drag 为 true 时, 获取不到拖拽文件 files 集合, 并直接预览上传资源。</li>
<li>[其他] global 整体组件源码逻辑优化, 更好的兼容 typescript 类型。</li>
<li>[优化] layer 组件 id 属性, 当值相同时仅保留最新的弹层实例。</li>
<li>[升级] layer-vue 1.4.6 版本。</li> <li>[升级] layer-vue 1.4.6 版本。</li>
</ul> </ul>
</li> </li>
</ul> </ul>
</lay-timeline-item>
<lay-timeline-item title="1.6.x">
<ul> <ul>
<a name="1-6-8"></a> <a name="1-6-8"></a>
<li> <li>

View File

@ -35,8 +35,8 @@ layui - vue谐音类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库 ,
<br> <br>
<lay-timeline> <lay-timeline>
<lay-timeline-item simple>欢迎在<a href="https://github.com/layui/layui-vue/issues/new">提交问题</a>上向我们反馈。欢迎功能请求。如果您想贡献,请查看<a href="https://gitee.com/layui/layui-vue/blob/next/CONTRIBUTING.md">快速指南</a></lay-timeline-item> <lay-timeline-item simple>欢迎在 <a href="https://gitee.com/layui/layui-vue/issues">提交问题</a> 上向我们反馈。欢迎功能请求。如果您想贡献,请查看 <a href="https://gitee.com/layui/layui-vue/blob/next/CONTRIBUTING.md">快速指南</a></lay-timeline-item>
<lay-timeline-item simple>如果您有什么想聊的,请随时加入我们的<a href="https://gitter.im/layui-vue/community">交流群</a></lay-timeline-item> <lay-timeline-item simple>如果您有什么想聊的,请随时加入我们的<a href="https://gitter.im/layui-vue/community"> Gitter</a></lay-timeline-item>
</lay-timeline> </lay-timeline>
::: title 环境要求 ::: title 环境要求

View File

@ -191,12 +191,6 @@ const menus = [
subTitle: "tagInput", subTitle: "tagInput",
path: "/zh-CN/components/tagInput", path: "/zh-CN/components/tagInput",
}, },
{
id: 39,
title: "树选择",
subTitle: "treeSelect",
path: "/zh-CN/components/treeSelect",
},
{ {
id: 40, id: 40,
title: "颜色选择器", title: "颜色选择器",