File size: 442 Bytes
b173115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { FileNodeInfo } from '@/api/files'
import { uniqueFile } from '@/util'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useBatchDownloadStore = defineStore('useBatchDownloadStore', () => {
  const selectdFiles = ref<FileNodeInfo[]>([])
  const addFiles = (files: FileNodeInfo[]) => {
    selectdFiles.value = uniqueFile([...selectdFiles.value,...files])
  }
  return {
    selectdFiles,
    addFiles
  }
})