File size: 775 Bytes
3a1d71c |
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 { FileNodeInfo } from '@/api/files'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { useGlobalStore } from './useGlobalStore'
export const useImgSliStore = defineStore('useImgSliStore', () => {
const fileDragging = ref(false)
const drawerVisible = ref(false)
const opened = ref(false)
const left = ref<FileNodeInfo>()
const right = ref<FileNodeInfo>()
const global = useGlobalStore()
const imgSliActived = computed(() => {
const tabs = global.tabList
for (const iter of tabs) {
if (iter.panes.find(v => v.key === iter.key)?.type === 'img-sli') {
return true
}
}
return false
})
return {
drawerVisible,
fileDragging,
left,
right,
imgSliActived,
opened
}
})
|