(component): 新增 table 组件 getCheckboxProps 与 getRadioProps 方法

This commit is contained in:
就眠儀式
2022-08-10 14:56:48 +08:00
parent 164d07fa93
commit 9ddf369176
3 changed files with 50 additions and 20 deletions

View File

@@ -698,7 +698,7 @@ export default {
<template>
<lay-button @click="changeSelectedKeys">修改选中值 {{ selectedKeys5 }}</lay-button>
<lay-table :columns="columns23" :data-source="dataSource23" v-model:selectedKeys="selectedKeys5"></lay-table>
<lay-table :columns="columns23" :data-source="dataSource23" v-model:selectedKeys="selectedKeys5" :getCheckboxProps="getCheckboxProps"></lay-table>
</template>
<script>
@@ -709,6 +709,13 @@ export default {
const selectedKeys5 = ref(["1"]);
const getCheckboxProps = (data,index) => {
if(index == 2) {
return {disabled: true}
}
return {};
}
const changeSelectedKeys = () => {
selectedKeys5.value = ["2"]
}
@@ -752,7 +759,8 @@ export default {
columns23,
dataSource23,
selectedKeys5,
changeSelectedKeys
changeSelectedKeys,
getCheckboxProps
}
}
}