Files
Melo/src/renderer/views/List/MusicList/useMusicDownload.js
T
2022-10-29 11:36:35 +08:00

26 lines
627 B
JavaScript

import { ref, nextTick } from '@common/utils/vueTools'
export default ({ selectedList, list }) => {
const isShowDownload = ref(false)
const isShowDownloadMultiple = ref(false)
const musicInfo = ref(null)
const handleShowDownloadModal = (index, single) => {
if (selectedList.value.length && !single) {
isShowDownloadMultiple.value = true
} else {
musicInfo.value = list.value[index]
nextTick(() => {
isShowDownload.value = true
})
}
}
return {
isShowDownload,
isShowDownloadMultiple,
selectedDownloadMusicInfo: musicInfo,
handleShowDownloadModal,
}
}