<a-table
:row-selection="rowSelection"
:columns="columnstk"
:data-source="datatk"
:pagination="false"
:scroll="{ y: 200 }"
:row-key="(record) => record"
>
<template #qrCode="{ record }">
<span v-if="record.processRelType == 1">
<a-input v-model:value="record.qrCode" placeholder="请输入绑码号" />
</span>
<span> </span>
</template>
<template #operation="{ record }">
<div class="editable-row-operations">
<span v-if="editableData[record.id]">
<a-button type="link" @click="save(record)">保存</a-button>
<a-button type="link" @click="canle(record.id)">取消</a-button>
</span>
<span v-else>
<a-button type="link" @click="edittbh(record.id)">编辑</a-button>
</span>
</div>
</template>
</a-table>
<a-table
:columns="columnsykg"
:data-source="dataykg"
:expand-icon-as-cell="false"
:default-expand-all="false"
class="components-table-demo-nested"
:pagination="false"
:showHeader="false"
:row-selection="rowselections"
:defaultExpandAllRows="defaultExpandAllRows"
v-if="dataykg && dataykg.length"
:row-key="(record) => record.id"
:expandIconColumnIndex="-1"
>
</a-table>
这里的selectedRowKeys1是表一的 通过下面这个勾选事件触发 表二 表一有长度 就禁用表一
反之 表二同理
const rowselections = {
onChange: (selectedRowKeys: Key[]) => {
// console.log(selectedRowKeys, '0000');
console.log(selectedRowKeys2.value, '222222');
},
getCheckboxProps: () => ({
disabled: selectedRowKeys1.value.length > 0 ? true : false, // Column configuration not to be checked
}),
};
如果使用折叠表格的话 想让表格一渲染就默认展开 并且隐藏折叠按钮的话
:defaultExpandAllRows="true" 默认首次展开
v-if="dataykg && dataykg.length" 有长度会每次都展开
:expandIconColumnIndex="-1" 隐藏按钮