parent
84b9ac5904
commit
3e05460d09
|
@ -10,7 +10,7 @@ import devWarning from '../../vc-util/devWarning';
|
||||||
import useMergedState from '../../_util/hooks/useMergedState';
|
import useMergedState from '../../_util/hooks/useMergedState';
|
||||||
import useState from '../../_util/hooks/useState';
|
import useState from '../../_util/hooks/useState';
|
||||||
import type { Ref } from 'vue';
|
import type { Ref } from 'vue';
|
||||||
import { computed, shallowRef, watchEffect } from 'vue';
|
import { computed, shallowRef } from 'vue';
|
||||||
import type { CheckboxProps } from '../../checkbox';
|
import type { CheckboxProps } from '../../checkbox';
|
||||||
import Checkbox from '../../checkbox';
|
import Checkbox from '../../checkbox';
|
||||||
import Dropdown from '../../dropdown';
|
import Dropdown from '../../dropdown';
|
||||||
|
@ -167,12 +167,14 @@ export default function useSelection<RecordType>(
|
||||||
// Save last selected key to enable range selection
|
// Save last selected key to enable range selection
|
||||||
const [lastSelectedKey, setLastSelectedKey] = useState<Key | null>(null);
|
const [lastSelectedKey, setLastSelectedKey] = useState<Key | null>(null);
|
||||||
|
|
||||||
// Reset if rowSelection reset
|
// // Reset if rowSelection reset
|
||||||
watchEffect(() => {
|
// we use computed to reset, donot need setMergedSelectedKeys again like react
|
||||||
if (!rowSelectionRef.value) {
|
// https://github.com/vueComponent/ant-design-vue/issues/4885
|
||||||
setMergedSelectedKeys([]);
|
// watchEffect(() => {
|
||||||
}
|
// if (!rowSelectionRef.value) {
|
||||||
});
|
// setMergedSelectedKeys([]);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
const setSelectedKeys = (keys: Key[]) => {
|
const setSelectedKeys = (keys: Key[]) => {
|
||||||
let availableKeys: Key[];
|
let availableKeys: Key[];
|
||||||
|
|
Loading…
Reference in New Issue