✨(component): update
This commit is contained in:
parent
fb5634a194
commit
97f2231ca9
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@layui/layui-vue",
|
"name": "@layui/layui-vue",
|
||||||
"version": "1.3.9",
|
"version": "1.3.11",
|
||||||
"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",
|
||||||
|
@ -37,7 +37,7 @@ const slot = useSlots();
|
|||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
"row",
|
"row",
|
||||||
"row-double",
|
"row-double",
|
||||||
"contextmenu",
|
"row-contextmenu",
|
||||||
"update:selectedKeys",
|
"update:selectedKeys",
|
||||||
"update:selectedKey",
|
"update:selectedKey",
|
||||||
]);
|
]);
|
||||||
@ -84,8 +84,8 @@ const rowDoubleClick = function (data: any, evt: MouseEvent) {
|
|||||||
emit("row-double", data, evt);
|
emit("row-double", data, evt);
|
||||||
};
|
};
|
||||||
|
|
||||||
const contextmenu = function (data: any, evt: MouseEvent) {
|
const rowContextmenu = function (data: any, evt: MouseEvent) {
|
||||||
emit("contextmenu", data, evt);
|
emit("row-contextmenu", data, evt);
|
||||||
};
|
};
|
||||||
|
|
||||||
const expandIconType = computed(() => {
|
const expandIconType = computed(() => {
|
||||||
@ -196,7 +196,7 @@ const renderFixedClassName = (column: any, columnIndex: number) => {
|
|||||||
:class="[renderRowClassName(data, index)]"
|
:class="[renderRowClassName(data, index)]"
|
||||||
@click.stop="rowClick(data, $event)"
|
@click.stop="rowClick(data, $event)"
|
||||||
@dblclick.stop="rowDoubleClick(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-for="(column, columnIndex) in columns" :key="columnIndex">
|
||||||
<template v-if="tableColumnKeys.includes(column.key)">
|
<template v-if="tableColumnKeys.includes(column.key)">
|
||||||
|
@ -66,12 +66,12 @@ const props = withDefaults(defineProps<LayTableProps>(), {
|
|||||||
const tableId = uuidv4();
|
const tableId = uuidv4();
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
"row",
|
|
||||||
"change",
|
"change",
|
||||||
"row-double",
|
|
||||||
"update:selectedKeys",
|
"update:selectedKeys",
|
||||||
"update:selectedKey",
|
"update:selectedKey",
|
||||||
"contextmenu",
|
"row-contextmenu",
|
||||||
|
"row-double",
|
||||||
|
"row",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const slot = useSlots();
|
const slot = useSlots();
|
||||||
@ -151,8 +151,8 @@ const rowDoubleClick = function (data: any, evt: MouseEvent) {
|
|||||||
emit("row-double", data, evt);
|
emit("row-double", data, evt);
|
||||||
};
|
};
|
||||||
|
|
||||||
const contextmenu = function (data: any, evt: MouseEvent) {
|
const rowContextmenu = function (data: any, evt: MouseEvent) {
|
||||||
emit("contextmenu", data, evt);
|
emit("row-contextmenu", data, evt);
|
||||||
};
|
};
|
||||||
|
|
||||||
const print = function () {
|
const print = function () {
|
||||||
@ -280,10 +280,7 @@ const getFixedColumn = () => {
|
|||||||
hasr.value = true;
|
hasr.value = true;
|
||||||
} else {
|
} else {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (
|
if (tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 > tableBody.value?.scrollWidth) {
|
||||||
tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 >
|
|
||||||
tableBody.value?.scrollWidth
|
|
||||||
) {
|
|
||||||
hasl.value = true;
|
hasl.value = true;
|
||||||
hasr.value = false;
|
hasr.value = false;
|
||||||
} else {
|
} else {
|
||||||
@ -575,7 +572,7 @@ const renderTotalRowCell = (column: any) => {
|
|||||||
:rowClassName="rowClassName"
|
:rowClassName="rowClassName"
|
||||||
@row="rowClick"
|
@row="rowClick"
|
||||||
@row-double="rowDoubleClick"
|
@row-double="rowDoubleClick"
|
||||||
@contextmenu="contextmenu"
|
@row-contextmenu="rowContextmenu"
|
||||||
v-model:selectedKeys="tableSelectedKeys"
|
v-model:selectedKeys="tableSelectedKeys"
|
||||||
v-model:selectedKey="tableSelectedKey"
|
v-model:selectedKey="tableSelectedKey"
|
||||||
>
|
>
|
||||||
|
@ -1119,10 +1119,11 @@ export default {
|
|||||||
|
|
||||||
::: table
|
::: table
|
||||||
|
|
||||||
| 属性 | 描述 | 参数 |
|
| 属性 | 描述 | 参数 |
|
||||||
| ---------- | ------ | ------------- |
|
| --------------- | ------ | ------------- |
|
||||||
| row | 行单击 | data : 当前行 |
|
| row | 行单击 | data : 当前行 |
|
||||||
| row-double | 行双击 | data : 当前行 |
|
| row-double | 行双击 | data : 当前行 |
|
||||||
|
| row-contextmenu | 行右击 | data : 当前行 |
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@ -1144,17 +1145,19 @@ export default {
|
|||||||
|
|
||||||
::: table
|
::: table
|
||||||
|
|
||||||
| 插槽 | 描述 | 类型 | 默认值 | 可选值 |
|
| 插槽 | 描述 | 类型 | 默认值 | 可选值 |
|
||||||
| --------------- | ------------------------------ | --------- | ------- | ----------------------- |
|
| --------------- | ------------------------------ | --------- | ------- | ---------------------------- |
|
||||||
| title | 列标题 | -- | -- | -- |
|
| title | 列标题 | -- | -- | -- |
|
||||||
| key | 数据字段 | -- | -- | -- |
|
| key | 数据字段 | -- | -- | -- |
|
||||||
| customSlot | 自定义插槽 | -- | -- | -- |
|
| customSlot | 自定义插槽 | -- | -- | -- |
|
||||||
| width | 宽度 | -- | -- | -- |
|
| width | 宽度 | -- | -- | -- |
|
||||||
| minWidth | 最小宽度 | -- | `100px` | -- |
|
| minWidth | 最小宽度 | -- | `100px` | -- |
|
||||||
| sort | 排序 | -- | -- | -- |
|
| sort | 排序 | -- | -- | -- |
|
||||||
| titleSlot | 标题插槽 | -- | -- | -- |
|
| titleSlot | 标题插槽 | -- | -- | -- |
|
||||||
| align | 对齐方式 | `string` | `left` | `left` `right` `center` |
|
| align | 对齐方式 | `string` | `left` | `left` `right` `center` |
|
||||||
| ellipsisTooltip | 当内容过长被隐藏时显示 tooltip | `boolean` | `false` | `true` `false` |
|
| ellipsisTooltip | 当内容过长被隐藏时显示 tooltip | `boolean` | `false` | `true` `false` |
|
||||||
|
| fixed | 列固定 | `string` | -- | `left` `right` |
|
||||||
|
| type | 列类型 | `string` | -- | `number` `checkbox` `radio` |
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
@ -11,6 +11,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<lay-timeline>
|
<lay-timeline>
|
||||||
<lay-timeline-item title="1.3.x">
|
<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>
|
<ul>
|
||||||
<a name="1-3-9"></a>
|
<a name="1-3-9"></a>
|
||||||
<li>
|
<li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user