📝: 更新日志

This commit is contained in:
就眠儀式 2022-05-01 01:17:31 +08:00
parent afc3de03c7
commit c31f944865
8 changed files with 98 additions and 49 deletions

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
export default { export default {
name: "StandardVue" name: "StandardVue",
} };
</script> </script>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
export default { export default {
name: "StandardRange" name: "StandardRange",
} };
</script> </script>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
export default { export default {
name: "Vertical" name: "Vertical",
} };
</script> </script>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
export default { export default {
name: "VerticalRange" name: "VerticalRange",
} };
</script> </script>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -0,0 +1,38 @@
<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,6 +5,7 @@ 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";
@ -56,6 +57,19 @@ const tableColumnKeys = ref(
}) })
); );
const tableColumns1 = [];
/**
* 复杂表头
*
* 思路 Column 处理为多级别 tr
*/
tableColumns.value.forEach((tableColumn) => {
})
watch( watch(
() => props.dataSource, () => props.dataSource,
() => { () => {
@ -269,26 +283,11 @@ onMounted(() => {
</div> </div>
</th> </th>
<template v-for="column in columns" :key="column"> <template v-for="column in columns" :key="column">
<th <column :tableColumnKeys="tableColumnKeys" :column="column">
class="layui-table-cell"
:style="{
textAlign: column.align,
flex: column.width ? '0 0 ' + column.width : '1',
}"
v-if="tableColumnKeys.includes(column.key)"
>
<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"
lay-sort="" lay-sort
> >
<i <i
@click.stop="sortTable($event, column.key, 'asc')" @click.stop="sortTable($event, column.key, 'asc')"
@ -301,7 +300,7 @@ onMounted(() => {
title="降序" title="降序"
></i> ></i>
</span> </span>
</th> </column>
</template> </template>
</tr> </tr>
</thead> </thead>

View File

@ -167,7 +167,6 @@ export default {
::: :::
::: title 开启排序 ::: title 开启排序
::: :::
@ -312,7 +311,7 @@ export default {
::: table ::: table
| 属性 | 描述 | 类型 | 默认值 | 可选值 | | 属性 | 描述 | 类型 | 默认值 | 可选值 |
| -------------------- | ----------------------------- | ---- | ------ | -------------- | | -------------------- | ----------------------------- | --------- | ------- | -------------- |
| columns | 列配置 - [更多](#tableColumn) | -- | -- | -- | | columns | 列配置 - [更多](#tableColumn) | -- | -- | -- |
| dataSource | 数据源 | -- | -- | -- | | dataSource | 数据源 | -- | -- | -- |
| checkbox | 开启复选框 | `boolean` | `false` | `true` `false` | | checkbox | 开启复选框 | `boolean` | `false` | `true` `false` |
@ -354,17 +353,16 @@ export default {
::: table ::: table
| 插槽 | 描述 | 类型 | 默认值 | 可选值 | | 插槽 | 描述 | 类型 | 默认值 | 可选值 |
| ---------- | ---------- | ---- |---- |---- | | ---------- | ---------- | -------- | ------ | ----------------------- |
| title | 列标题 | -- |-- |-- | | title | 列标题 | -- | -- | -- |
| key | 数据字段 | -- |-- |-- | | key | 数据字段 | -- | -- | -- |
| customSlot | 自定义插槽 | -- |-- |-- | | customSlot | 自定义插槽 | -- | -- | -- |
| width | 宽度 | -- |-- |-- | | width | 宽度 | -- | -- | -- |
| sort | 排序 | -- |-- |-- | | sort | 排序 | -- | -- | -- |
| titleSlot | 标题插槽 | -- |-- |-- | | titleSlot | 标题插槽 | -- | -- | -- |
| align | 对齐方式 | `string` | `left` | `left` `right` `center` | | align | 对齐方式 | `string` | `left` | `left` `right` `center` |
::: :::
::: previousNext table ::: previousNext table
::: :::

View File

@ -11,6 +11,20 @@
<template> <template>
<lay-timeline> <lay-timeline>
<lay-timeline-item title="1.0.x"> <lay-timeline-item title="1.0.x">
<ul>
<a name="1-0-5"> </a>
<li>
<h3>1.0.5 <span class="layui-badge-rim">2022-05-01</span></h3>
<ul>
<li>[新增] dropdown 组件 context-menu 属性。。</li>
<li>[修复] layer 组件 tooltip 组件 index 层级冲突。</li>
<li>[修复] table 组件 columns 宽度超出 table-box 错位。</li>
<li>[修复] table 组件 selected-keys 属性 deep 监听。</li>
<li>[修复] slider 组件 btn 背景色。</li>
<li>[修复] upload 组件 url 失效。</li>
</ul>
</li>
</ul>
<ul> <ul>
<a name="1-0-4"> </a> <a name="1-0-4"> </a>
<li> <li>