fix: table pagination deep watch

This commit is contained in:
tjz 2018-07-17 21:22:48 +08:00
parent 2e1c19471e
commit c65e1def1b

View File

@ -86,17 +86,20 @@ export default {
}
},
watch: {
pagination (val) {
this.setState(previousState => {
const newPagination = {
...defaultPagination,
...previousState.sPagination,
...val,
}
newPagination.current = newPagination.current || 1
newPagination.pageSize = newPagination.pageSize || 10
return { sPagination: val !== false ? newPagination : emptyObject }
})
pagination: {
handler (val) {
this.setState(previousState => {
const newPagination = {
...defaultPagination,
...previousState.sPagination,
...val,
}
newPagination.current = newPagination.current || 1
newPagination.pageSize = newPagination.pageSize || 10
return { sPagination: val !== false ? newPagination : emptyObject }
})
},
deep: true,
},
rowSelection: {
handler (val) {