✨(component): 新增 table 组件 getCheckboxProps 与 getRadioProps 方法
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user