[发布] 0.2.4 版本
This commit is contained in:
parent
6baec91cdd
commit
2347a18beb
@ -43,7 +43,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:void(0)"> 0.2.3 </a>
|
||||
<a href="javascript:void(0)"> 0.2.4 </a>
|
||||
</li>
|
||||
</ul>
|
||||
</lay-header>
|
||||
@ -319,16 +319,12 @@ export default {
|
||||
},
|
||||
]
|
||||
|
||||
const selected = ref(1)
|
||||
|
||||
const handleClick = function (menu) {
|
||||
selected.value = menu.id
|
||||
router.push(menu.path)
|
||||
}
|
||||
|
||||
return {
|
||||
menus,
|
||||
selected,
|
||||
currentPath,
|
||||
handleClick,
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
>
|
||||
</div>
|
||||
<div class="site-version">
|
||||
<span>当前版本:v<cite class="site-showv">0.2.3</cite></span>
|
||||
<span>当前版本:v<cite class="site-showv">0.2.4</cite></span>
|
||||
<span
|
||||
><router-link
|
||||
class="layui-inline site-down"
|
||||
|
@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "@layui/layui-vue",
|
||||
"version": "0.2.3",
|
||||
"version": "0.2.4",
|
||||
"description": "a component library for Vue 3 base on layui-vue",
|
||||
"main": "lib/layui-vue.umd.js",
|
||||
"homepage": "https://gitee.com/layui-vue/layui-vue/blob/master/README.md",
|
||||
"module": "lib/layui-vue.es.js",
|
||||
"main": "lib/layui-vue.umd.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/layui-vue.es.js",
|
||||
|
@ -1,71 +1,3 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="layui-transfer layui-form layui-border-box">
|
||||
<div class="layui-transfer-box" style="width: 200px; height: 360px">
|
||||
<div class="layui-transfer-header">
|
||||
<lay-checkbox
|
||||
v-model="allLeftChecked"
|
||||
skin="primary"
|
||||
label="all"
|
||||
@change="allLeftChange"
|
||||
>
|
||||
<span>{{ title[0] }}</span>
|
||||
</lay-checkbox>
|
||||
</div>
|
||||
<ul class="layui-transfer-data" style="height: 320px">
|
||||
<li v-for="dataSource in leftDataSource" :key="dataSource">
|
||||
<lay-checkbox
|
||||
v-model="leftSelectedKeys"
|
||||
skin="primary"
|
||||
:label="dataSource[id]"
|
||||
>
|
||||
<slot v-if="slot.item" name="item" :data="dataSource" />
|
||||
<span v-else>{{ dataSource.title }}</span>
|
||||
</lay-checkbox>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-transfer-active">
|
||||
<lay-button
|
||||
type="primary"
|
||||
:disabled="leftSelectedKeys.length == 0"
|
||||
@click="add"
|
||||
><i class="layui-icon layui-icon-next"
|
||||
/></lay-button>
|
||||
<lay-button
|
||||
type="primary"
|
||||
:disabled="rightSelectedKeys.length == 0"
|
||||
@click="remove"
|
||||
><i class="layui-icon layui-icon-prev"
|
||||
/></lay-button>
|
||||
</div>
|
||||
<div class="layui-transfer-box" style="width: 200px; height: 360px">
|
||||
<div class="layui-transfer-header">
|
||||
<lay-checkbox
|
||||
v-model="allRightChecked"
|
||||
skin="primary"
|
||||
label="all"
|
||||
@change="allRightChange"
|
||||
>
|
||||
<span>{{ title[1] }}</span>
|
||||
</lay-checkbox>
|
||||
</div>
|
||||
<ul class="layui-transfer-data" style="height: 320px">
|
||||
<li v-for="dataSource in rightDataSource" :key="dataSource">
|
||||
<lay-checkbox
|
||||
v-model="rightSelectedKeys"
|
||||
skin="primary"
|
||||
:label="dataSource[id]"
|
||||
>
|
||||
<slot v-if="slot.item" name="item" :data="dataSource" />
|
||||
<span v-else>{{ dataSource.title }}</span>
|
||||
</lay-checkbox>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LayTransfer",
|
||||
@ -77,25 +9,18 @@ import { Recordable } from "../type";
|
||||
|
||||
const slot = useSlots();
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
id?: string;
|
||||
title?: string[];
|
||||
dataSource: Recordable[];
|
||||
}>(),
|
||||
{
|
||||
id: "id",
|
||||
title: function () {
|
||||
return ["主列表", "副列表"];
|
||||
},
|
||||
dataSource: function () {
|
||||
return [];
|
||||
},
|
||||
selectedKeys: function () {
|
||||
return [];
|
||||
},
|
||||
}
|
||||
);
|
||||
export interface LayTransferProps {
|
||||
id?: string;
|
||||
title?: string[];
|
||||
dataSource: Recordable[];
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<LayTransferProps>(), {
|
||||
id: "id",
|
||||
title: () => ["主列表", "副列表"],
|
||||
dataSource: () => [],
|
||||
selectedKeys: () => [],
|
||||
});
|
||||
|
||||
const leftDataSource: Ref<any[]> = ref([...props.dataSource]);
|
||||
const rightDataSource: Ref<any[]> = ref([]);
|
||||
@ -188,3 +113,72 @@ const remove = function () {
|
||||
rightSelectedKeys.value = [];
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="layui-transfer layui-form layui-border-box">
|
||||
<div class="layui-transfer-box" style="width: 200px; height: 360px">
|
||||
<div class="layui-transfer-header">
|
||||
<lay-checkbox
|
||||
v-model="allLeftChecked"
|
||||
skin="primary"
|
||||
label="all"
|
||||
@change="allLeftChange"
|
||||
>
|
||||
<span>{{ title[0] }}</span>
|
||||
</lay-checkbox>
|
||||
</div>
|
||||
<ul class="layui-transfer-data" style="height: 320px">
|
||||
<li v-for="dataSource in leftDataSource" :key="dataSource">
|
||||
<lay-checkbox
|
||||
v-model="leftSelectedKeys"
|
||||
skin="primary"
|
||||
:label="dataSource[id]"
|
||||
>
|
||||
<slot v-if="slot.item" name="item" :data="dataSource" />
|
||||
<span v-else>{{ dataSource.title }}</span>
|
||||
</lay-checkbox>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-transfer-active">
|
||||
<lay-button
|
||||
type="primary"
|
||||
:disabled="leftSelectedKeys.length == 0"
|
||||
@click="add"
|
||||
><i class="layui-icon layui-icon-next"
|
||||
/></lay-button>
|
||||
<lay-button
|
||||
type="primary"
|
||||
:disabled="rightSelectedKeys.length == 0"
|
||||
@click="remove"
|
||||
><i class="layui-icon layui-icon-prev"
|
||||
/></lay-button>
|
||||
</div>
|
||||
<div class="layui-transfer-box" style="width: 200px; height: 360px">
|
||||
<div class="layui-transfer-header">
|
||||
<lay-checkbox
|
||||
v-model="allRightChecked"
|
||||
skin="primary"
|
||||
label="all"
|
||||
@change="allRightChange"
|
||||
>
|
||||
<span>{{ title[1] }}</span>
|
||||
</lay-checkbox>
|
||||
</div>
|
||||
<ul class="layui-transfer-data" style="height: 320px">
|
||||
<li v-for="dataSource in rightDataSource" :key="dataSource">
|
||||
<lay-checkbox
|
||||
v-model="rightSelectedKeys"
|
||||
skin="primary"
|
||||
:label="dataSource[id]"
|
||||
>
|
||||
<slot v-if="slot.item" name="item" :data="dataSource" />
|
||||
<span v-else>{{ dataSource.title }}</span>
|
||||
</lay-checkbox>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
@ -5,13 +5,13 @@ export default {
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { StringOrNumber } from '/@src/module/tree/tree.type'
|
||||
import { Nullable } from '/@src/module/type'
|
||||
import { StringOrNumber } from './tree.type'
|
||||
import { Nullable } from '../type'
|
||||
|
||||
import LayIcon from '../icon'
|
||||
import LayCheckbox from '../checkbox'
|
||||
import { Ref } from 'vue'
|
||||
import { Tree } from '/@src/module/tree/tree'
|
||||
import { Tree } from './tree'
|
||||
|
||||
type CustomKey = string | number
|
||||
type CustomString = (() => string) | string
|
||||
|
@ -14,8 +14,8 @@ export default {
|
||||
<script lang="ts" setup>
|
||||
import TreeNode from './TreeNode.vue'
|
||||
import { computed } from 'vue'
|
||||
import { useTree } from '/@src/module/tree/useTree'
|
||||
import { TreeData } from '/@src/module/tree/tree'
|
||||
import { useTree } from './useTree'
|
||||
import { TreeData } from './tree'
|
||||
|
||||
type StringFn = () => string
|
||||
type StringOrNumber = string | number
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { OriginalTreeData, StringOrNumber } from '/@src/module/tree/tree.type'
|
||||
import { Nullable } from '/@src/module/type'
|
||||
import { OriginalTreeData, StringOrNumber } from './tree.type'
|
||||
import { Nullable } from '../type'
|
||||
import { Ref, ref } from 'vue'
|
||||
|
||||
type CustomKey = string | number
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { TreeEmits, TreeProps } from '/@src/module/tree/tree.type'
|
||||
import { TreeEmits, TreeProps } from './tree.type'
|
||||
import { computed, ComputedRef, watch } from 'vue'
|
||||
import { Tree, TreeData } from '/@src/module/tree/tree'
|
||||
import { Tree, TreeData } from './tree'
|
||||
|
||||
export declare type UseTree = (
|
||||
props: TreeProps,
|
||||
|
Loading…
Reference in New Issue
Block a user