【升级】更新table组件重置问题,感谢QQ群 影子 发现问题并贡献

pull/22/head
小诺 2021-04-20 00:30:16 +08:00 committed by 俞宝山
parent 2514612c33
commit e329010c67
1 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,7 @@
<script>
import draggable from 'vuedraggable'
export default {
props: {
columns: {
@ -45,7 +46,7 @@
},
methods: {
reset() {
this.columnsSetting = this.originColumns
this.columnsSetting = JSON.parse(JSON.stringify(this.originColumns))
this.indeterminate = false
this.checkAll = true
this.emitColumnChange()
@ -71,7 +72,7 @@
},
mounted() {
this.columnsSetting = this.columns.map(value => ({ ...value, checked: true }))
this.originColumns = [...this.columnsSetting]
this.originColumns = JSON.parse(JSON.stringify(this.columnsSetting))
}
}
</script>