: 发布 1.0.5 版本

This commit is contained in:
就眠儀式 2022-05-01 15:03:02 +08:00
parent c31f944865
commit 48f8f64ff4
5 changed files with 26 additions and 57 deletions

View File

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

@ -1,38 +0,0 @@
<template>
<th
v-if="tableColumnKeys.includes(column.key)"
class="layui-table-cell"
:style="{
textAlign: column.align,
flex: column.width ? '0 0 ' + column.width : '1',
}"
>
<span>
<template v-if="column.titleSlot">
<slot :name="column.titleSlot"></slot>
</template>
<template v-else>
{{ column.title }}
</template>
</span>
<!-- 插槽 -->
<slot></slot>
</th>
</template>
<script lang="ts">
export default {
name: "Column",
};
</script>
<script lang="ts" setup>
export interface LayTableProps {
column?: any;
tableColumnKeys?: any;
}
const props = withDefaults(defineProps<LayTableProps>(), {
});
</script>

View File

@ -5,7 +5,6 @@ export default {
</script> </script>
<script setup lang="ts"> <script setup lang="ts">
import Column from "./Column.vue";
import { ref, watch, useSlots, withDefaults, onMounted } from "vue"; import { ref, watch, useSlots, withDefaults, onMounted } from "vue";
import { v4 as uuidv4 } from "../../utils/guidUtil"; import { v4 as uuidv4 } from "../../utils/guidUtil";
import { Recordable } from "../../types"; import { Recordable } from "../../types";
@ -57,19 +56,6 @@ const tableColumnKeys = ref(
}) })
); );
const tableColumns1 = [];
/**
* 复杂表头
*
* 思路 Column 处理为多级别 tr
*/
tableColumns.value.forEach((tableColumn) => {
})
watch( watch(
() => props.dataSource, () => props.dataSource,
() => { () => {
@ -283,7 +269,23 @@ onMounted(() => {
</div> </div>
</th> </th>
<template v-for="column in columns" :key="column"> <template v-for="column in columns" :key="column">
<column :tableColumnKeys="tableColumnKeys" :column="column"> <th
v-if="tableColumnKeys.includes(column.key)"
class="layui-table-cell"
:style="{
textAlign: column.align,
flex: column.width ? '0 0 ' + column.width : '1',
}"
>
<span>
<template v-if="column.titleSlot">
<slot :name="column.titleSlot"></slot>
</template>
<template v-else>
{{ column.title }}
</template>
</span>
<!-- 插槽 -->
<span <span
v-if="column.sort" v-if="column.sort"
class="layui-table-sort layui-inline" class="layui-table-sort layui-inline"
@ -300,7 +302,7 @@ onMounted(() => {
title="降序" title="降序"
></i> ></i>
</span> </span>
</column> </th>
</template> </template>
</tr> </tr>
</thead> </thead>

View File

@ -116,6 +116,11 @@ a:hover {
color: #777; color: #777;
} }
a cite {
font-style: normal;
*cursor: pointer;
}
.layui-border-box, .layui-border-box,
.layui-border-box * { .layui-border-box * {
box-sizing: border-box; box-sizing: border-box;

View File

@ -43,7 +43,7 @@
rel="nofollow" rel="nofollow"
class="site-star" class="site-star"
> >
<i class="layui-icon"></i> Star <cite id="getStars">746</cite> <i class="layui-icon"></i> Star <cite id="getStars">863</cite>
</a> </a>
<a <a
href="https://gitee.com/layui-vue" href="https://gitee.com/layui-vue"