[发布] 0.2.4 版本

This commit is contained in:
就眠儀式 2021-11-19 09:16:09 +08:00
parent 6baec91cdd
commit 2347a18beb
8 changed files with 95 additions and 104 deletions

View File

@ -43,7 +43,7 @@
</a> </a>
</li> </li>
<li class="layui-nav-item"> <li class="layui-nav-item">
<a href="javascript:void(0)"> 0.2.3 </a> <a href="javascript:void(0)"> 0.2.4 </a>
</li> </li>
</ul> </ul>
</lay-header> </lay-header>
@ -319,16 +319,12 @@ export default {
}, },
] ]
const selected = ref(1)
const handleClick = function (menu) { const handleClick = function (menu) {
selected.value = menu.id
router.push(menu.path) router.push(menu.path)
} }
return { return {
menus, menus,
selected,
currentPath, currentPath,
handleClick, handleClick,
} }

View File

@ -28,7 +28,7 @@
> >
</div> </div>
<div class="site-version"> <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 <span
><router-link ><router-link
class="layui-inline site-down" class="layui-inline site-down"

View File

@ -1,9 +1,10 @@
{ {
"name": "@layui/layui-vue", "name": "@layui/layui-vue",
"version": "0.2.3", "version": "0.2.4",
"description": "a component library for Vue 3 base on layui-vue", "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", "module": "lib/layui-vue.es.js",
"main": "lib/layui-vue.umd.js",
"exports": { "exports": {
".": { ".": {
"import": "./lib/layui-vue.es.js", "import": "./lib/layui-vue.es.js",

View File

@ -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"> <script lang="ts">
export default { export default {
name: "LayTransfer", name: "LayTransfer",
@ -77,25 +9,18 @@ import { Recordable } from "../type";
const slot = useSlots(); const slot = useSlots();
const props = withDefaults( export interface LayTransferProps {
defineProps<{ id?: string;
id?: string; title?: string[];
title?: string[]; dataSource: Recordable[];
dataSource: Recordable[]; }
}>(),
{ const props = withDefaults(defineProps<LayTransferProps>(), {
id: "id", id: "id",
title: function () { title: () => ["主列表", "副列表"],
return ["主列表", "副列表"]; dataSource: () => [],
}, selectedKeys: () => [],
dataSource: function () { });
return [];
},
selectedKeys: function () {
return [];
},
}
);
const leftDataSource: Ref<any[]> = ref([...props.dataSource]); const leftDataSource: Ref<any[]> = ref([...props.dataSource]);
const rightDataSource: Ref<any[]> = ref([]); const rightDataSource: Ref<any[]> = ref([]);
@ -188,3 +113,72 @@ const remove = function () {
rightSelectedKeys.value = []; rightSelectedKeys.value = [];
}; };
</script> </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>

View File

@ -5,13 +5,13 @@ export default {
</script> </script>
<script setup lang="ts"> <script setup lang="ts">
import { StringOrNumber } from '/@src/module/tree/tree.type' import { StringOrNumber } from './tree.type'
import { Nullable } from '/@src/module/type' import { Nullable } from '../type'
import LayIcon from '../icon' import LayIcon from '../icon'
import LayCheckbox from '../checkbox' import LayCheckbox from '../checkbox'
import { Ref } from 'vue' import { Ref } from 'vue'
import { Tree } from '/@src/module/tree/tree' import { Tree } from './tree'
type CustomKey = string | number type CustomKey = string | number
type CustomString = (() => string) | string type CustomString = (() => string) | string

View File

@ -14,8 +14,8 @@ export default {
<script lang="ts" setup> <script lang="ts" setup>
import TreeNode from './TreeNode.vue' import TreeNode from './TreeNode.vue'
import { computed } from 'vue' import { computed } from 'vue'
import { useTree } from '/@src/module/tree/useTree' import { useTree } from './useTree'
import { TreeData } from '/@src/module/tree/tree' import { TreeData } from './tree'
type StringFn = () => string type StringFn = () => string
type StringOrNumber = string | number type StringOrNumber = string | number

View File

@ -1,5 +1,5 @@
import { OriginalTreeData, StringOrNumber } from '/@src/module/tree/tree.type' import { OriginalTreeData, StringOrNumber } from './tree.type'
import { Nullable } from '/@src/module/type' import { Nullable } from '../type'
import { Ref, ref } from 'vue' import { Ref, ref } from 'vue'
type CustomKey = string | number type CustomKey = string | number

View File

@ -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 { computed, ComputedRef, watch } from 'vue'
import { Tree, TreeData } from '/@src/module/tree/tree' import { Tree, TreeData } from './tree'
export declare type UseTree = ( export declare type UseTree = (
props: TreeProps, props: TreeProps,