mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-09 04:31:35 +08:00
feat(advanced-table): add disabled to selection type
This commit is contained in:
parent
e704c31721
commit
210e091239
@ -70,10 +70,10 @@ const sex = [
|
||||
const _columns3 = ($this) => {
|
||||
return [
|
||||
{
|
||||
type: 'selection'
|
||||
// canCheck (params, index) {
|
||||
// return params.row.age < 8
|
||||
// }
|
||||
type: 'selection',
|
||||
disabled (params, index) {
|
||||
return params.row.age < 8
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Name',
|
||||
@ -193,7 +193,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getData (args) {
|
||||
let d = new Array(23).fill(0)
|
||||
let d = new Array(20).fill(0)
|
||||
d = d.map((item, idx) => {
|
||||
return {
|
||||
name: 'xiaobai' + idx,
|
||||
|
@ -130,11 +130,11 @@
|
||||
>
|
||||
<!-- 批量选择 -->
|
||||
<n-checkbox
|
||||
v-if="column.type === 'selection' && (column.canCheck && !column.canCheck(rowData,i))"
|
||||
v-if="column.type === 'selection' && (column.disabled && !column.disabled(rowData,i))"
|
||||
v-model="checkBoxes[rowData._index]"
|
||||
/>
|
||||
<n-checkbox
|
||||
v-else-if="column.type === 'selection' && (column.canCheck && column.canCheck(rowData,i))"
|
||||
v-else-if="column.type === 'selection' && (column.disabled && column.disabled(rowData,i))"
|
||||
v-model="disabledCheckBox[rowData._index]"
|
||||
:disabled="!(disabledCheckBox[rowData._index]=false)"
|
||||
/>
|
||||
@ -632,7 +632,6 @@ export default {
|
||||
})
|
||||
},
|
||||
onAllCheckboxesClick () {
|
||||
this.allCheckboxesSelect = this.currentPageAllSelect
|
||||
this.showingData.forEach((item) => {
|
||||
this.checkBoxes[item._index] = this.currentPageAllSelect
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user