mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
de0696b4f6
* bumping version * build(core): bumping vue version - Bumping up vue version from ^3.0.0 to ^3.0.3 due to the change of `emitOptions` * Remove transition mock/Add before-enter and before-leave hook emitter for popper
23 lines
730 B
TypeScript
23 lines
730 B
TypeScript
export const LEFT_CHECK_CHANGE_EVENT = 'left-check-change'
|
|
export const RIGHT_CHECK_CHANGE_EVENT = 'right-check-change'
|
|
|
|
import type { TransferCheckedState, Key } from './transfer'
|
|
export const useCheckedChange = (checkedState: TransferCheckedState, emit) => {
|
|
const onSourceCheckedChange = (val: Key[], movedKeys: Key[]) => {
|
|
checkedState.leftChecked = val
|
|
if (movedKeys === undefined) return
|
|
emit(LEFT_CHECK_CHANGE_EVENT, val, movedKeys)
|
|
}
|
|
|
|
const onTargetCheckedChange = (val: Key[], movedKeys: Key[]) => {
|
|
checkedState.rightChecked = val
|
|
if (movedKeys === undefined) return
|
|
emit(RIGHT_CHECK_CHANGE_EVENT, val, movedKeys)
|
|
}
|
|
|
|
return {
|
|
onSourceCheckedChange,
|
|
onTargetCheckedChange,
|
|
}
|
|
}
|