(component): 优化 table 组件 dataSource 属性改变时, 清空 selectedKey 与 selectedKeys 属性

This commit is contained in:
就眠儀式 2022-08-15 09:12:51 +08:00
parent 6450dfb1ad
commit 08a682eaba
2 changed files with 15 additions and 3 deletions

View File

@ -93,6 +93,7 @@ const emit = defineEmits([
const slot = useSlots();
const slots = slot.default && slot.default();
const s = "";
const allChecked = ref(false);
const hasChecked = ref(false);
const tableDataSource = ref<any[]>([...props.dataSource]);
@ -257,6 +258,8 @@ watch(
() => props.dataSource,
() => {
tableDataSource.value = [...props.dataSource];
tableSelectedKeys.value = [];
tableSelectedKey.value = s;
nextTick(() => {
getScrollWidth();
});
@ -316,11 +319,11 @@ const rowDoubleClick = function (data: any, evt: MouseEvent) {
emit("row-double", data, evt);
};
const rowContextmenu = function (data: any, evt: MouseEvent) {
const rowContextmenu = (data: any, evt: MouseEvent) => {
emit("row-contextmenu", data, evt);
};
const print = function () {
const print = () => {
let subOutputRankPrint = document.getElementById(tableId) as HTMLElement;
let newContent = subOutputRankPrint.innerHTML;
let oldContent = document.body.innerHTML;

View File

@ -11,7 +11,16 @@
<template>
<lay-timeline>
<lay-timeline-item title="1.4.x">
<ul>
<ul>
<a name="1-3-14"></a>
<li>
<h3>1.4.1 <span class="layui-badge-rim">2022-08-14</span></h3>
<ul>
<li>[修复] 表格开启复选框之后不使用getCheckboxProps属性点击时全选会报错。</li>
</ul>
</li>
</ul>
<ul>
<a name="1-3-14"></a>
<li>
<h3>1.4.1 <span class="layui-badge-rim">2022-08-14</span></h3>