wujingjing
2025-03-03 1075860848d14e3d6d1506b91d9c9039433bf4cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { ref } from 'vue';
 
export type AttachType = 'file' | 'table';
export type Attach<T = any> = {
    title: string;
    type: AttachType;
    model: T;
    icon?: string;
    iconClass?: string;
};
 
export const useAttach = () => {
    const attachList = ref<Attach[]>([]);
 
    
 
    const removeAttach = (index: number) => {
        attachList.value.splice(index, 1);
    };
 
    const clearAttach = () => {
        attachList.value = [];
    };
 
    return {
        attachList,
        removeAttach,
        clearAttach,
    };
};