wangrong
2026-08-13 25aad646f6e19a23b1903c5d2e1f2cacf3142a9d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { useCore } from "../../../hooks";
 
export function useSelection({ emit }: { emit: Vue.Emit }) {
    const { crud } = useCore();
 
    // 选择项发生变化
    function onSelectionChange(selection: any[]) {
        crud.selection.splice(0, crud.selection.length, ...selection);
        emit("selection-change", crud.selection);
    }
 
    return {
        selection: crud.selection,
        onSelectionChange
    };
}