fix: 全选更新无效
This commit is contained in:
parent
47cd966b89
commit
6b1d22d439
@ -9,7 +9,7 @@
|
|||||||
<a-divider />
|
<a-divider />
|
||||||
<div class="ant-checkbox-group">
|
<div class="ant-checkbox-group">
|
||||||
<div>
|
<div>
|
||||||
<draggable v-model="columnsSetting" animation="300" @end="dragEnd">
|
<draggable v-model="columnsSetting" animation="300" @end="emitColumnChange">
|
||||||
<div class="s-tool-column-item" v-for="item in columnsSetting" :key="item.title">
|
<div class="s-tool-column-item" v-for="item in columnsSetting" :key="item.title">
|
||||||
<div class="s-tool-column-handle" >
|
<div class="s-tool-column-handle" >
|
||||||
<a-icon type="more"/>
|
<a-icon type="more"/>
|
||||||
@ -48,12 +48,13 @@
|
|||||||
this.columnsSetting = this.originColumns
|
this.columnsSetting = this.originColumns
|
||||||
this.indeterminate = false
|
this.indeterminate = false
|
||||||
this.checkAll = true
|
this.checkAll = true
|
||||||
|
this.emitColumnChange()
|
||||||
},
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
const checkedList = this.columnsSetting.filter(value => value.checked)
|
const checkedList = this.columnsSetting.filter(value => value.checked)
|
||||||
this.indeterminate = !!checkedList.length && checkedList.length < this.columnsSetting.length
|
this.indeterminate = !!checkedList.length && checkedList.length < this.columnsSetting.length
|
||||||
this.checkAll = checkedList.length === this.columnsSetting.length
|
this.checkAll = checkedList.length === this.columnsSetting.length
|
||||||
this.$emit('columnChange', this.columnsSetting)
|
this.emitColumnChange()
|
||||||
},
|
},
|
||||||
onCheckAllChange(e) {
|
onCheckAllChange(e) {
|
||||||
const val = e.target.checked
|
const val = e.target.checked
|
||||||
@ -62,8 +63,9 @@
|
|||||||
checkAll: val,
|
checkAll: val,
|
||||||
columnsSetting: this.columns.map(value => ({ ...value, checked: val }))
|
columnsSetting: this.columns.map(value => ({ ...value, checked: val }))
|
||||||
})
|
})
|
||||||
|
this.emitColumnChange()
|
||||||
},
|
},
|
||||||
dragEnd() {
|
emitColumnChange() {
|
||||||
this.$emit('columnChange', this.columnsSetting)
|
this.$emit('columnChange', this.columnsSetting)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,8 @@ export default {
|
|||||||
localDataSource: [],
|
localDataSource: [],
|
||||||
localPagination: Object.assign({}, this.pagination),
|
localPagination: Object.assign({}, this.pagination),
|
||||||
isFullscreen: false,
|
isFullscreen: false,
|
||||||
customSize: this.size
|
customSize: this.size,
|
||||||
|
columnsSetting: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: Object.assign({}, T.props, {
|
props: Object.assign({}, T.props, {
|
||||||
@ -292,6 +293,7 @@ export default {
|
|||||||
) */
|
) */
|
||||||
},
|
},
|
||||||
columnChange(val) {
|
columnChange(val) {
|
||||||
|
console.log(val)
|
||||||
this.columnsSetting = val
|
this.columnsSetting = val
|
||||||
},
|
},
|
||||||
renderHeader () {
|
renderHeader () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user