mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 03:08:21 +08:00
fix(components): [table] inaccurate type of toggleRowSelection
(#17687)
This commit is contained in:
parent
506b5f84aa
commit
c76cc8bc92
@ -321,7 +321,7 @@ table/table-layout
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| clearSelection | used in multiple selection Table, clear user selection | ^[Function]`() => void` |
|
||||
| getSelectionRows | returns the currently selected rows | ^[Function]`() => void` |
|
||||
| toggleRowSelection | used in multiple selection Table, toggle if a certain row is selected. With the second parameter, you can directly set if this row is selected | ^[Function]`(row: any, selected: boolean) => void` |
|
||||
| toggleRowSelection | used in multiple selection Table, toggle if a certain row is selected. With the second parameter, you can directly set if this row is selected | ^[Function]`(row: any, selected?: boolean) => void` |
|
||||
| toggleAllSelection | used in multiple selection Table, toggle select all and deselect all | ^[Function]`() => void` |
|
||||
| toggleRowExpansion | used in expandable Table or tree Table, toggle if a certain row is expanded. With the second parameter, you can directly set if this row is expanded or collapsed | ^[Function]`(row: any, expanded?: boolean) => void` |
|
||||
| setCurrentRow | used in single selection Table, set a certain row selected. If called without any parameter, it will clear selection | ^[Function]`(row: any) => void` |
|
||||
|
@ -190,7 +190,7 @@ function useWatcher<T>() {
|
||||
|
||||
const toggleRowSelection = (
|
||||
row: T,
|
||||
selected = undefined,
|
||||
selected?: boolean,
|
||||
emitChange = true
|
||||
) => {
|
||||
const changed = toggleRowStatus(selection.value, row, selected)
|
||||
|
@ -8,7 +8,7 @@ function useUtils<T>(store: Store<T>) {
|
||||
const getSelectionRows = () => {
|
||||
return store.getSelectionRows()
|
||||
}
|
||||
const toggleRowSelection = (row: T, selected: boolean) => {
|
||||
const toggleRowSelection = (row: T, selected?: boolean) => {
|
||||
store.toggleRowSelection(row, selected, false)
|
||||
store.updateAllSelected()
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ export function compose(...funcs) {
|
||||
export function toggleRowStatus<T>(
|
||||
statusArr: T[],
|
||||
row: T,
|
||||
newVal: boolean
|
||||
newVal?: boolean
|
||||
): boolean {
|
||||
let changed = false
|
||||
const index = statusArr.indexOf(row)
|
||||
|
Loading…
Reference in New Issue
Block a user