🐛(transfer): 修复 transfer-data 高度

更新文档
This commit is contained in:
就眠儀式 2022-06-13 22:09:32 +08:00
parent 9512497e65
commit 196d30d15a
4 changed files with 27 additions and 12 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@layui/layui-vue", "name": "@layui/layui-vue",
"version": "1.1.7-alpha.3", "version": "1.1.7",
"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

@ -30,7 +30,7 @@ const props = withDefaults(defineProps<LayInputProps>(), {
readonly: false, readonly: false,
allowClear: false, allowClear: false,
autofocus: false, autofocus: false,
modelValue: "" modelValue: "",
}); });
const emit = defineEmits([ const emit = defineEmits([

View File

@ -12,7 +12,7 @@ import LayButton from "../button/index.vue";
import LayCheckbox from "../checkbox/index.vue"; import LayCheckbox from "../checkbox/index.vue";
import { computed, Ref, ref, useSlots, watch } from "vue"; import { computed, Ref, ref, useSlots, watch } from "vue";
import { BooleanOrString, Recordable } from "../../types"; import { BooleanOrString, Recordable } from "../../types";
import { computedAsync } from '@vueuse/core'; import { computedAsync } from "@vueuse/core";
export interface LayTransferProps { export interface LayTransferProps {
id?: string; id?: string;
@ -33,7 +33,7 @@ const props = withDefaults(defineProps<LayTransferProps>(), {
showSearch: false, showSearch: false,
selectedKeys: () => [], selectedKeys: () => [],
width: "200px", width: "200px",
height: "360px" height: "360px",
}); });
const leftDataSource: Ref<any[]> = ref([...props.dataSource]); const leftDataSource: Ref<any[]> = ref([...props.dataSource]);
@ -171,10 +171,15 @@ const searchRight = (e: any) => {
const boxStyle = computed(() => { const boxStyle = computed(() => {
return { return {
width: props.width, width: props.width,
height: props.height height: props.height,
};
});
const dataStyle = computed(() => {
return {
height: props.showSearch ? 'calc(100% - 97px)' : 'calc(100% - 38px)'
} }
}) })
</script> </script>
<template> <template>
@ -192,9 +197,13 @@ const boxStyle = computed(() => {
</LayCheckbox> </LayCheckbox>
</div> </div>
<div class="layui-transfer-search" v-if="showSearch"> <div class="layui-transfer-search" v-if="showSearch">
<lay-input prefix-icon="layui-icon-search" @input="searchLeft" placeholder="关键词搜索"></lay-input> <lay-input
prefix-icon="layui-icon-search"
@input="searchLeft"
placeholder="关键词搜索"
></lay-input>
</div> </div>
<ul class="layui-transfer-data" style="height:320px"> <ul class="layui-transfer-data" :style="dataStyle">
<li v-for="dataSource in leftDataSource" :key="dataSource"> <li v-for="dataSource in leftDataSource" :key="dataSource">
<LayCheckbox <LayCheckbox
v-model="leftSelectedKeys" v-model="leftSelectedKeys"
@ -233,9 +242,13 @@ const boxStyle = computed(() => {
</LayCheckbox> </LayCheckbox>
</div> </div>
<div class="layui-transfer-search" v-if="showSearch"> <div class="layui-transfer-search" v-if="showSearch">
<lay-input prefix-icon="layui-icon-search" @input="searchRight" placeholder="关键词搜索"></lay-input> <lay-input
prefix-icon="layui-icon-search"
@input="searchRight"
placeholder="关键词搜索"
></lay-input>
</div> </div>
<ul class="layui-transfer-data" style="height: 320px"> <ul class="layui-transfer-data" :style="dataStyle">
<li v-for="dataSource in rightDataSource" :key="dataSource"> <li v-for="dataSource in rightDataSource" :key="dataSource">
<LayCheckbox <LayCheckbox
v-model="rightSelectedKeys" v-model="rightSelectedKeys"

View File

@ -19,8 +19,10 @@
<li>[新增] upload 组件 default 插槽, 允许自定义上传入口</li> <li>[新增] upload 组件 default 插槽, 允许自定义上传入口</li>
<li>[新增] transfer 组件 width 与 height 属性, 允许自定义盒子尺寸</li> <li>[新增] transfer 组件 width 与 height 属性, 允许自定义盒子尺寸</li>
<li>[新增] table 组件 max-height 与 height 属性, 超出指定高度标题固定</li> <li>[新增] table 组件 max-height 与 height 属性, 超出指定高度标题固定</li>
<li>[修复] transfer 组件 input 样式, 由原生 input 修改为 lay-input</li> <li>[修复] transfer 组件 input 样式, 由原生 input 修改为 lay-input 组件</li>
<li>[修复] table 组件 按需加载 时, 内置 checkbox 无法正常解析</li> <li>[修复] transfer 组件 transfer-data 高度超出 transfer-box 的问题</li>
<li>[修复] table 组件 按需加载 时, 内置 checkbox 无法正常显示的问题</li>
<li>[优化] input 组件 modelValue 属性非必填, 使用 @input 回调取值</li>
</ul> </ul>
</li> </li>
</ul> </ul>