mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-24 12:45:18 +08:00
fix(data-table): onUpdatePage and onUpdatePageSize not triggered in jsx (#768)
* fix(data-table): onUpdatePage and onUpdatePageSize not triggered * update change log * Update CHANGELOG.en-US.md Co-authored-by: Jiwen Bai <56228105@qq.com> Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
parent
ca57743687
commit
05ef8cba49
@ -9,6 +9,7 @@
|
||||
### Fixes
|
||||
|
||||
- Fix `n-slider` loss floating point decimal precision, closes [#751](https://github.com/TuSimple/naive-ui/issues/751).
|
||||
- Fix `n-data-table` `onUpdatePage` and `onUpdatePageSize` not triggered while using jsx.
|
||||
|
||||
## 2.16.0 (2021-08-02)
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
### Fixes
|
||||
|
||||
- 修复 `n-slider` 丢失浮点数小数精度,关闭 [#751](https://github.com/TuSimple/naive-ui/issues/751)
|
||||
- 修复 `n-data-table` `onUpdatePage` 和 `onUpdatePageSize` 在使用 jsx 时不触发的问题
|
||||
|
||||
## 2.16.0 (2021-08-02)
|
||||
|
||||
|
@ -348,15 +348,21 @@ export function useTableData (
|
||||
})
|
||||
|
||||
function doUpdatePage (page: number): void {
|
||||
const { 'onUpdate:page': onUpdatePage, onPageChange } = props
|
||||
const { 'onUpdate:page': _onUpdatePage, onPageChange, onUpdatePage } = props
|
||||
if (onUpdatePage) call(onUpdatePage, page)
|
||||
if (onPageChange) call(onPageChange, page)
|
||||
if (_onUpdatePage) call(_onUpdatePage, page)
|
||||
uncontrolledCurrentPageRef.value = page
|
||||
}
|
||||
function doUpdatePageSize (pageSize: number): void {
|
||||
const { 'onUpdate:pageSize': onUpdatePageSize, onPageSizeChange } = props
|
||||
const {
|
||||
'onUpdate:pageSize': _onUpdatePageSize,
|
||||
onPageSizeChange,
|
||||
onUpdatePageSize
|
||||
} = props
|
||||
if (onPageSizeChange) call(onPageSizeChange, pageSize)
|
||||
if (onUpdatePageSize) call(onUpdatePageSize, pageSize)
|
||||
if (_onUpdatePageSize) call(_onUpdatePageSize, pageSize)
|
||||
uncontrolledPageSizeRef.value = pageSize
|
||||
}
|
||||
function doUpdateSorter (sortState: SortState | null): void {
|
||||
|
Loading…
Reference in New Issue
Block a user