✨(component): update
This commit is contained in:
		
							parent
							
								
									fb5634a194
								
							
						
					
					
						commit
						97f2231ca9
					
				@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "@layui/layui-vue",
 | 
			
		||||
  "version": "1.3.9",
 | 
			
		||||
  "version": "1.3.11",
 | 
			
		||||
  "author": "就眠儀式",
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "description": "a component library for Vue 3 base on layui-vue",
 | 
			
		||||
 | 
			
		||||
@ -37,7 +37,7 @@ const slot = useSlots();
 | 
			
		||||
const emit = defineEmits([
 | 
			
		||||
  "row",
 | 
			
		||||
  "row-double",
 | 
			
		||||
  "contextmenu",
 | 
			
		||||
  "row-contextmenu",
 | 
			
		||||
  "update:selectedKeys",
 | 
			
		||||
  "update:selectedKey",
 | 
			
		||||
]);
 | 
			
		||||
@ -84,8 +84,8 @@ const rowDoubleClick = function (data: any, evt: MouseEvent) {
 | 
			
		||||
  emit("row-double", data, evt);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const contextmenu = function (data: any, evt: MouseEvent) {
 | 
			
		||||
  emit("contextmenu", data, evt);
 | 
			
		||||
const rowContextmenu = function (data: any, evt: MouseEvent) {
 | 
			
		||||
  emit("row-contextmenu", data, evt);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const expandIconType = computed(() => {
 | 
			
		||||
@ -196,7 +196,7 @@ const renderFixedClassName = (column: any, columnIndex: number) => {
 | 
			
		||||
    :class="[renderRowClassName(data, index)]"
 | 
			
		||||
    @click.stop="rowClick(data, $event)"
 | 
			
		||||
    @dblclick.stop="rowDoubleClick(data, $event)"
 | 
			
		||||
    @contextmenu.stop="contextmenu(data, $event)"
 | 
			
		||||
    @contextmenu.stop="rowContextmenu(data, $event)"
 | 
			
		||||
  >
 | 
			
		||||
    <template v-for="(column, columnIndex) in columns" :key="columnIndex">
 | 
			
		||||
      <template v-if="tableColumnKeys.includes(column.key)">
 | 
			
		||||
 | 
			
		||||
@ -66,12 +66,12 @@ const props = withDefaults(defineProps<LayTableProps>(), {
 | 
			
		||||
const tableId = uuidv4();
 | 
			
		||||
 | 
			
		||||
const emit = defineEmits([
 | 
			
		||||
  "row",
 | 
			
		||||
  "change",
 | 
			
		||||
  "row-double",
 | 
			
		||||
  "update:selectedKeys",
 | 
			
		||||
  "update:selectedKey",
 | 
			
		||||
  "contextmenu",
 | 
			
		||||
  "row-contextmenu",
 | 
			
		||||
  "row-double",
 | 
			
		||||
  "row",
 | 
			
		||||
]);
 | 
			
		||||
 | 
			
		||||
const slot = useSlots();
 | 
			
		||||
@ -151,8 +151,8 @@ const rowDoubleClick = function (data: any, evt: MouseEvent) {
 | 
			
		||||
  emit("row-double", data, evt);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const contextmenu = function (data: any, evt: MouseEvent) {
 | 
			
		||||
  emit("contextmenu", data, evt);
 | 
			
		||||
const rowContextmenu = function (data: any, evt: MouseEvent) {
 | 
			
		||||
  emit("row-contextmenu", data, evt);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const print = function () {
 | 
			
		||||
@ -280,10 +280,7 @@ const getFixedColumn = () => {
 | 
			
		||||
      hasr.value = true;
 | 
			
		||||
    } else {
 | 
			
		||||
      // @ts-ignore
 | 
			
		||||
      if (
 | 
			
		||||
        tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 >
 | 
			
		||||
        tableBody.value?.scrollWidth
 | 
			
		||||
      ) {
 | 
			
		||||
      if (tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 > tableBody.value?.scrollWidth) {
 | 
			
		||||
        hasl.value = true;
 | 
			
		||||
        hasr.value = false;
 | 
			
		||||
      } else {
 | 
			
		||||
@ -575,7 +572,7 @@ const renderTotalRowCell = (column: any) => {
 | 
			
		||||
                  :rowClassName="rowClassName"
 | 
			
		||||
                  @row="rowClick"
 | 
			
		||||
                  @row-double="rowDoubleClick"
 | 
			
		||||
                  @contextmenu="contextmenu"
 | 
			
		||||
                  @row-contextmenu="rowContextmenu"
 | 
			
		||||
                  v-model:selectedKeys="tableSelectedKeys"
 | 
			
		||||
                  v-model:selectedKey="tableSelectedKey"
 | 
			
		||||
                >
 | 
			
		||||
 | 
			
		||||
@ -1119,10 +1119,11 @@ export default {
 | 
			
		||||
 | 
			
		||||
::: table
 | 
			
		||||
 | 
			
		||||
| 属性       | 描述   | 参数          |
 | 
			
		||||
| ---------- | ------ | ------------- |
 | 
			
		||||
| row        | 行单击 | data : 当前行 |
 | 
			
		||||
| row-double | 行双击 | data : 当前行 |
 | 
			
		||||
| 属性            | 描述   | 参数          |
 | 
			
		||||
| --------------- | ------ | ------------- |
 | 
			
		||||
| row             | 行单击 | data : 当前行 |
 | 
			
		||||
| row-double      | 行双击 | data : 当前行 |
 | 
			
		||||
| row-contextmenu | 行右击 | data : 当前行 |
 | 
			
		||||
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
@ -1144,17 +1145,19 @@ export default {
 | 
			
		||||
 | 
			
		||||
::: table
 | 
			
		||||
 | 
			
		||||
| 插槽            | 描述                           | 类型      | 默认值  | 可选值                  |
 | 
			
		||||
| --------------- | ------------------------------ | --------- | ------- | ----------------------- |
 | 
			
		||||
| title           | 列标题                         | --        | --      | --                      |
 | 
			
		||||
| key             | 数据字段                       | --        | --      | --                      |
 | 
			
		||||
| customSlot      | 自定义插槽                     | --        | --      | --                      |
 | 
			
		||||
| width           | 宽度                           | --        | --      | --                      |
 | 
			
		||||
| minWidth        | 最小宽度                       | --        | `100px`      | --                      |
 | 
			
		||||
| sort            | 排序                           | --        | --      | --                      |
 | 
			
		||||
| titleSlot       | 标题插槽                       | --        | --      | --                      |
 | 
			
		||||
| align           | 对齐方式                       | `string`  | `left`  | `left` `right` `center` |
 | 
			
		||||
| ellipsisTooltip | 当内容过长被隐藏时显示 tooltip | `boolean` | `false` | `true` `false`          |
 | 
			
		||||
| 插槽            | 描述                           | 类型      | 默认值  | 可选值                          |
 | 
			
		||||
| --------------- | ------------------------------ | --------- | ------- | ----------------------------  |
 | 
			
		||||
| title           | 列标题                         | --        | --      | --                             |
 | 
			
		||||
| key             | 数据字段                       | --        | --      | --                             |
 | 
			
		||||
| customSlot      | 自定义插槽                     | --        | --      | --                             |
 | 
			
		||||
| width           | 宽度                           | --        | --      | --                             |
 | 
			
		||||
| minWidth        | 最小宽度                       | --        | `100px` | --                              |
 | 
			
		||||
| sort            | 排序                           | --        | --      | --                              |
 | 
			
		||||
| titleSlot       | 标题插槽                       | --        | --      | --                              |
 | 
			
		||||
| align           | 对齐方式                       | `string`  | `left`  | `left` `right` `center`         |
 | 
			
		||||
| ellipsisTooltip | 当内容过长被隐藏时显示 tooltip  | `boolean`  | `false` | `true` `false`                 |
 | 
			
		||||
| fixed           | 列固定                         | `string`   | --      | `left` `right`                 |
 | 
			
		||||
| type            | 列类型                         | `string`   | --      | `number` `checkbox` `radio`    |
 | 
			
		||||
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,27 @@
 | 
			
		||||
<template>
 | 
			
		||||
<lay-timeline>
 | 
			
		||||
  <lay-timeline-item title="1.3.x">
 | 
			
		||||
    <ul> 
 | 
			
		||||
      <a name="1-3-11"></a> 
 | 
			
		||||
      <li> 
 | 
			
		||||
        <h3>1.3.11 <span class="layui-badge-rim">2022-08-03</span></h3> 
 | 
			
		||||
        <ul>     
 | 
			
		||||
          <li>[新增] table 组件 row-contextmenu 事件, 处理行右击。</li>
 | 
			
		||||
          <li>[修复] tree 组件 checkedKeys 属性, 响应特性失效。</li>
 | 
			
		||||
        </ul>
 | 
			
		||||
      </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
    <ul> 
 | 
			
		||||
      <a name="1-3-10"></a> 
 | 
			
		||||
      <li> 
 | 
			
		||||
        <h3>1.3.10 <span class="layui-badge-rim">2022-07-31</span></h3> 
 | 
			
		||||
        <ul>     
 | 
			
		||||
          <li>[优化] table 组件 columns 配置固定列开启时, 未固定的最后一列出现双边框。</li>
 | 
			
		||||
          <li>[优化] table 组件 columns 配置固定列阴影计算逻辑存在细微偏差。</li>
 | 
			
		||||
          <li>[优化] table 组件子表格嵌套下无下边框的问题。</li>
 | 
			
		||||
        </ul>
 | 
			
		||||
      </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
    <ul> 
 | 
			
		||||
      <a name="1-3-9"></a> 
 | 
			
		||||
      <li> 
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user