✨(transfer): 新增 width 与 height 属性
更新文档
This commit is contained in:
parent
56cfd1bef0
commit
9512497e65
@ -16,7 +16,7 @@ export interface LayInputProps {
|
|||||||
value?: string;
|
value?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
modelValue: string;
|
modelValue?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
allowClear?: boolean;
|
allowClear?: boolean;
|
||||||
autofocus?: boolean;
|
autofocus?: boolean;
|
||||||
@ -30,6 +30,7 @@ const props = withDefaults(defineProps<LayInputProps>(), {
|
|||||||
readonly: false,
|
readonly: false,
|
||||||
allowClear: false,
|
allowClear: false,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
modelValue: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
|
@ -45,16 +45,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.layui-transfer-search .layui-input {
|
.layui-transfer-search .layui-input {
|
||||||
height: 32px;
|
height: 35px;
|
||||||
padding-left: 30px;
|
padding-left: 2px;
|
||||||
font-size: 12px;
|
font-size: 13px;
|
||||||
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-transfer-search .layui-icon-search {
|
.layui-transfer-search .layui-icon-search {
|
||||||
position: absolute;
|
|
||||||
left: 20px;
|
|
||||||
top: 50%;
|
|
||||||
margin-top: -8px;
|
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,17 +6,22 @@ export default {
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
import LayScroll from "../scroll";
|
import LayInput from "../input/index.vue";
|
||||||
|
import LayScroll from "../scroll/index.vue";
|
||||||
import LayButton from "../button/index.vue";
|
import LayButton from "../button/index.vue";
|
||||||
import LayCheckbox from "../checkbox/index.vue";
|
import LayCheckbox from "../checkbox/index.vue";
|
||||||
import { 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';
|
||||||
|
|
||||||
export interface LayTransferProps {
|
export interface LayTransferProps {
|
||||||
id?: string;
|
id?: string;
|
||||||
title?: string[];
|
title?: string[];
|
||||||
|
width?: string;
|
||||||
|
height?: string;
|
||||||
showSearch?: BooleanOrString;
|
showSearch?: BooleanOrString;
|
||||||
dataSource: Recordable[];
|
dataSource: Recordable[];
|
||||||
|
selectedKeys: Recordable[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const slot = useSlots();
|
const slot = useSlots();
|
||||||
@ -27,6 +32,8 @@ const props = withDefaults(defineProps<LayTransferProps>(), {
|
|||||||
dataSource: () => [],
|
dataSource: () => [],
|
||||||
showSearch: false,
|
showSearch: false,
|
||||||
selectedKeys: () => [],
|
selectedKeys: () => [],
|
||||||
|
width: "200px",
|
||||||
|
height: "360px"
|
||||||
});
|
});
|
||||||
|
|
||||||
const leftDataSource: Ref<any[]> = ref([...props.dataSource]);
|
const leftDataSource: Ref<any[]> = ref([...props.dataSource]);
|
||||||
@ -160,12 +167,20 @@ const searchRight = (e: any) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const boxStyle = computed(() => {
|
||||||
|
return {
|
||||||
|
width: props.width,
|
||||||
|
height: props.height
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="layui-transfer layui-form layui-border-box">
|
<div class="layui-transfer layui-form layui-border-box">
|
||||||
<div class="layui-transfer-box" style="width: 200px; height: 360px">
|
<div class="layui-transfer-box" :style="boxStyle">
|
||||||
<div class="layui-transfer-header">
|
<div class="layui-transfer-header">
|
||||||
<LayCheckbox
|
<LayCheckbox
|
||||||
v-model="allLeftChecked"
|
v-model="allLeftChecked"
|
||||||
@ -177,15 +192,9 @@ const searchRight = (e: any) => {
|
|||||||
</LayCheckbox>
|
</LayCheckbox>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-transfer-search" v-if="showSearch">
|
<div class="layui-transfer-search" v-if="showSearch">
|
||||||
<i class="layui-icon layui-icon-search"></i
|
<lay-input prefix-icon="layui-icon-search" @input="searchLeft" placeholder="关键词搜索"></lay-input>
|
||||||
><input
|
|
||||||
type="input"
|
|
||||||
class="layui-input"
|
|
||||||
@input="searchLeft"
|
|
||||||
placeholder="关键词搜索"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<ul class="layui-transfer-data" style="height: 320px">
|
<ul class="layui-transfer-data" style="height:320px">
|
||||||
<li v-for="dataSource in leftDataSource" :key="dataSource">
|
<li v-for="dataSource in leftDataSource" :key="dataSource">
|
||||||
<LayCheckbox
|
<LayCheckbox
|
||||||
v-model="leftSelectedKeys"
|
v-model="leftSelectedKeys"
|
||||||
@ -212,7 +221,7 @@ const searchRight = (e: any) => {
|
|||||||
><i class="layui-icon layui-icon-prev"></i
|
><i class="layui-icon layui-icon-prev"></i
|
||||||
></LayButton>
|
></LayButton>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-transfer-box" style="width: 200px; height: 360px">
|
<div class="layui-transfer-box" :style="boxStyle">
|
||||||
<div class="layui-transfer-header">
|
<div class="layui-transfer-header">
|
||||||
<LayCheckbox
|
<LayCheckbox
|
||||||
v-model="allRightChecked"
|
v-model="allRightChecked"
|
||||||
@ -224,13 +233,7 @@ const searchRight = (e: any) => {
|
|||||||
</LayCheckbox>
|
</LayCheckbox>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-transfer-search" v-if="showSearch">
|
<div class="layui-transfer-search" v-if="showSearch">
|
||||||
<i class="layui-icon layui-icon-search"></i
|
<lay-input prefix-icon="layui-icon-search" @input="searchRight" placeholder="关键词搜索"></lay-input>
|
||||||
><input
|
|
||||||
type="input"
|
|
||||||
class="layui-input"
|
|
||||||
@input="searchRight"
|
|
||||||
placeholder="关键词搜索"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<ul class="layui-transfer-data" style="height: 320px">
|
<ul class="layui-transfer-data" style="height: 320px">
|
||||||
<li v-for="dataSource in rightDataSource" :key="dataSource">
|
<li v-for="dataSource in rightDataSource" :key="dataSource">
|
||||||
|
@ -171,6 +171,8 @@ export default {
|
|||||||
| title | 标题 | -- |
|
| title | 标题 | -- |
|
||||||
| id | 主键 | -- |
|
| id | 主键 | -- |
|
||||||
| showSearch | 开启搜索 | -- |
|
| showSearch | 开启搜索 | -- |
|
||||||
|
| width | 左右盒子宽度 | `200px` |
|
||||||
|
| height | 左右盒子高度 | `360px` |
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
<h3>1.1.7 <span class="layui-badge-rim">2022-06-13</span></h3>
|
<h3>1.1.7 <span class="layui-badge-rim">2022-06-13</span></h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>[新增] upload 组件 default 插槽, 允许自定义上传入口</li>
|
<li>[新增] upload 组件 default 插槽, 允许自定义上传入口</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>[修复] table 组件 按需加载 时, 内置 checkbox 无法正常解析</li>
|
<li>[修复] table 组件 按需加载 时, 内置 checkbox 无法正常解析</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user