升级到 vue3

This commit is contained in:
lyswhut
2021-12-03 22:11:11 +08:00
parent c6635e554a
commit 8059d9cd73
260 changed files with 14443 additions and 10979 deletions
@@ -0,0 +1,31 @@
import { ref, onBeforeUnmount, toRef } from '@renderer/utils/vueTools'
import { player as eventPlayerNames } from '@renderer/event/names'
import { playProgress } from '@renderer/core/share/playProgress'
export default () => {
const isActiveTransition = ref(false)
const progress = toRef(playProgress, 'progress')
const nowPlayTimeStr = toRef(playProgress, 'nowPlayTimeStr')
const maxPlayTimeStr = toRef(playProgress, 'maxPlayTimeStr')
const handleTransitionEnd = () => {
isActiveTransition.value = false
}
const handleActiveTransition = () => {
isActiveTransition.value = true
}
window.eventHub.on(eventPlayerNames.activeTransition, handleActiveTransition)
onBeforeUnmount(() => {
window.eventHub.off(eventPlayerNames.activeTransition, handleActiveTransition)
})
return {
nowPlayTimeStr,
maxPlayTimeStr,
progress,
isActiveTransition,
handleTransitionEnd,
}
}