(component): update

This commit is contained in:
就眠儀式 2022-08-06 10:07:08 +08:00
parent 48cacb8d91
commit 5f12770a73
4 changed files with 57 additions and 42 deletions

View File

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

@ -24,6 +24,7 @@ import LayDropdown from "../dropdown/index.vue";
import LayPage from "../page/index.vue"; import LayPage from "../page/index.vue";
import LayEmpty from "../empty/index.vue"; import LayEmpty from "../empty/index.vue";
import TableRow from "./TableRow.vue"; import TableRow from "./TableRow.vue";
import { nextTick } from 'vue';
export interface LayTableProps { export interface LayTableProps {
id?: string; id?: string;
@ -88,6 +89,7 @@ const allChecked = ref(false);
const hasChecked = ref(false); const hasChecked = ref(false);
const tableDataSource = ref<any[]>([...props.dataSource]); const tableDataSource = ref<any[]>([...props.dataSource]);
const tableColumns = ref([...props.columns]); const tableColumns = ref([...props.columns]);
const tableColumnKeys = ref( const tableColumnKeys = ref(
props.columns.map((item: any) => { props.columns.map((item: any) => {
if (item.hide != true) { if (item.hide != true) {
@ -128,6 +130,9 @@ watch(
() => props.dataSource, () => props.dataSource,
() => { () => {
tableDataSource.value = [...props.dataSource]; tableDataSource.value = [...props.dataSource];
nextTick(() => {
getScrollWidth();
})
}, },
{ deep: true } { deep: true }
); );
@ -270,8 +275,8 @@ const sortTable = (e: any, key: string, sort: string) => {
} }
}; };
let tableHeader = ref<HTMLElement | null>(null);
let tableBody = ref<HTMLElement | null>(null); let tableBody = ref<HTMLElement | null>(null);
let tableHeader = ref<HTMLElement | null>(null);
let scrollWidthCell = ref(0); let scrollWidthCell = ref(0);
const getScrollWidth = () => { const getScrollWidth = () => {

View File

@ -1278,7 +1278,7 @@ export default {
::: table ::: table
| 属性 | 描述 | 类型 | 默认值 | 可选值 | | 属性 | 描述 | 类型 | 默认值 | 可选值 |
| -------------------- | ----------------------------- | --------- | ------- | -------------- | | -------------------- | ----------------------------------------------------- | ------------------- | ---------- | ------------------ |
| columns | 列配置 - [更多](#tableColumn) | -- | -- | -- | | columns | 列配置 - [更多](#tableColumn) | -- | -- | -- |
| dataSource | 数据源 | -- | -- | -- | | dataSource | 数据源 | -- | -- | -- |
| checkbox | 开启复选框 | `boolean` | `false` | `true` `false` | | checkbox | 开启复选框 | `boolean` | `false` | `true` `false` |
@ -1336,7 +1336,7 @@ export default {
::: table ::: table
| 插槽 | 描述 | 类型 | 默认值 | 可选值 | | 插槽 | 描述 | 类型 | 默认值 | 可选值 |
| --------------- | ------------------------------ | --------- | ------- | ---------------------------- | | --------------- | ------------------------------ | --------- | ------- | --------------------------- |
| title | 列标题 | -- | -- | -- | | title | 列标题 | -- | -- | -- |
| key | 数据字段 | -- | -- | -- | | key | 数据字段 | -- | -- | -- |
| customSlot | 自定义插槽 | -- | -- | -- | | customSlot | 自定义插槽 | -- | -- | -- |

View File

@ -11,6 +11,16 @@
<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-14"></a>
<li>
<h3>1.3.14 <span class="layui-badge-rim">2022-08-06</span></h3>
<ul>
<li>[修复] button 组件 hover 状态无效果的问题。</li>
<li>[修复] table 组件 data-source 远程加载后 scroll 计算错误。 </li>
</ul>
</li>
</ul>
<ul> <ul>
<a name="1-3-13"></a> <a name="1-3-13"></a>
<li> <li>