📝: 更新日志
This commit is contained in:
		
							parent
							
								
									afc3de03c7
								
							
						
					
					
						commit
						c31f944865
					
				@ -1,7 +1,7 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
export default {
 | 
			
		||||
  name: "StandardVue"
 | 
			
		||||
}
 | 
			
		||||
  name: "StandardVue",
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
export default {
 | 
			
		||||
  name: "StandardRange"
 | 
			
		||||
}
 | 
			
		||||
  name: "StandardRange",
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
export default {
 | 
			
		||||
  name: "Vertical"
 | 
			
		||||
}
 | 
			
		||||
  name: "Vertical",
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
export default {
 | 
			
		||||
  name: "VerticalRange"
 | 
			
		||||
}
 | 
			
		||||
  name: "VerticalRange",
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										38
									
								
								package/component/src/component/table/Column.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								package/component/src/component/table/Column.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@ -5,6 +5,7 @@ export default {
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import Column from "./Column.vue";
 | 
			
		||||
import { ref, watch, useSlots, withDefaults, onMounted } from "vue";
 | 
			
		||||
import { v4 as uuidv4 } from "../../utils/guidUtil";
 | 
			
		||||
import { Recordable } from "../../types";
 | 
			
		||||
@ -56,6 +57,19 @@ const tableColumnKeys = ref(
 | 
			
		||||
  })
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
const tableColumns1 = [];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 复杂表头 
 | 
			
		||||
 * 
 | 
			
		||||
 * 思路:将 Column 处理为多级别 tr。
 | 
			
		||||
 */
 | 
			
		||||
tableColumns.value.forEach((tableColumn) => {
 | 
			
		||||
  
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
watch(
 | 
			
		||||
  () => props.dataSource,
 | 
			
		||||
  () => {
 | 
			
		||||
@ -268,27 +282,12 @@ onMounted(() => {
 | 
			
		||||
                    />
 | 
			
		||||
                  </div>
 | 
			
		||||
                </th>
 | 
			
		||||
                <template v-for="column in columns" :key="column">
 | 
			
		||||
                  <th
 | 
			
		||||
                    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>
 | 
			
		||||
                <template v-for="column in columns" :key="column">  
 | 
			
		||||
                  <column :tableColumnKeys="tableColumnKeys" :column="column">
 | 
			
		||||
                    <span
 | 
			
		||||
                      v-if="column.sort"
 | 
			
		||||
                      class="layui-table-sort layui-inline"
 | 
			
		||||
                      lay-sort=""
 | 
			
		||||
                      lay-sort
 | 
			
		||||
                    >
 | 
			
		||||
                      <i
 | 
			
		||||
                        @click.stop="sortTable($event, column.key, 'asc')"
 | 
			
		||||
@ -301,7 +300,7 @@ onMounted(() => {
 | 
			
		||||
                        title="降序"
 | 
			
		||||
                      ></i>
 | 
			
		||||
                    </span>
 | 
			
		||||
                  </th>
 | 
			
		||||
                  </column>
 | 
			
		||||
                </template>
 | 
			
		||||
              </tr>
 | 
			
		||||
            </thead>
 | 
			
		||||
 | 
			
		||||
@ -167,7 +167,6 @@ export default {
 | 
			
		||||
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
::: title 开启排序
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
@ -311,15 +310,15 @@ export default {
 | 
			
		||||
 | 
			
		||||
::: table
 | 
			
		||||
 | 
			
		||||
| 属性                 | 描述                          | 类型 | 默认值 | 可选值         |
 | 
			
		||||
| -------------------- | ----------------------------- | ---- | ------ | -------------- |
 | 
			
		||||
| columns              | 列配置 - [更多](#tableColumn) | --   | --     | --             |
 | 
			
		||||
| dataSource           | 数据源                        | --   | --     | --             |
 | 
			
		||||
| checkbox             | 开启复选框                    | `boolean`   | `false`     | `true` `false`             |
 | 
			
		||||
| id                   | 主键                          | `string`   | --     | --             |
 | 
			
		||||
| v-model:selectedKeys | 选中项                        | --   | --     | --             |
 | 
			
		||||
| default-toolbar      | 工具栏                        | `boolean`   | `false`     | `true` `false` |
 | 
			
		||||
| size                 | 尺寸                          | `string`   | `md`     | `lg` `md` `sm` |
 | 
			
		||||
| 属性                 | 描述                          | 类型      | 默认值  | 可选值         |
 | 
			
		||||
| -------------------- | ----------------------------- | --------- | ------- | -------------- |
 | 
			
		||||
| columns              | 列配置 - [更多](#tableColumn) | --        | --      | --             |
 | 
			
		||||
| dataSource           | 数据源                        | --        | --      | --             |
 | 
			
		||||
| checkbox             | 开启复选框                    | `boolean` | `false` | `true` `false` |
 | 
			
		||||
| id                   | 主键                          | `string`  | --      | --             |
 | 
			
		||||
| v-model:selectedKeys | 选中项                        | --        | --      | --             |
 | 
			
		||||
| default-toolbar      | 工具栏                        | `boolean` | `false` | `true` `false` |
 | 
			
		||||
| size                 | 尺寸                          | `string`  | `md`    | `lg` `md` `sm` |
 | 
			
		||||
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
@ -353,18 +352,17 @@ export default {
 | 
			
		||||
 | 
			
		||||
::: table
 | 
			
		||||
 | 
			
		||||
| 插槽       | 描述       | 类型 | 默认值 | 可选值 |
 | 
			
		||||
| ---------- | ---------- | ---- |---- |---- |
 | 
			
		||||
| title      | 列标题     | --   |--   |--   |
 | 
			
		||||
| key        | 数据字段   | --   |--   |--   |
 | 
			
		||||
| customSlot | 自定义插槽 | --   |--   |--   |
 | 
			
		||||
| width      | 宽度       | --   |--   |--   |
 | 
			
		||||
| sort       | 排序       | --   |--   |--   |
 | 
			
		||||
| titleSlot  | 标题插槽   | --   |--   |--   |
 | 
			
		||||
| align      | 对齐方式   | `string` | `left` | `left` `right` `center`   |
 | 
			
		||||
| 插槽       | 描述       | 类型     | 默认值 | 可选值                  |
 | 
			
		||||
| ---------- | ---------- | -------- | ------ | ----------------------- |
 | 
			
		||||
| title      | 列标题     | --       | --     | --                      |
 | 
			
		||||
| key        | 数据字段   | --       | --     | --                      |
 | 
			
		||||
| customSlot | 自定义插槽 | --       | --     | --                      |
 | 
			
		||||
| width      | 宽度       | --       | --     | --                      |
 | 
			
		||||
| sort       | 排序       | --       | --     | --                      |
 | 
			
		||||
| titleSlot  | 标题插槽   | --       | --     | --                      |
 | 
			
		||||
| align      | 对齐方式   | `string` | `left` | `left` `right` `center` |
 | 
			
		||||
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
::: previousNext table
 | 
			
		||||
:::
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,20 @@
 | 
			
		||||
<template>
 | 
			
		||||
<lay-timeline>
 | 
			
		||||
  <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> 
 | 
			
		||||
      <a name="1-0-4"> </a> 
 | 
			
		||||
      <li> 
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user