mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
28 lines
669 B
TypeScript
28 lines
669 B
TypeScript
import { useStore } from 'vuex'
|
|
import { State, MutationTypes } from '@/store'
|
|
import { enterFullscreen, exitFullscreen, isFullscreen } from '@/utils/fullscreen'
|
|
|
|
export default () => {
|
|
const store = useStore<State>()
|
|
|
|
const enterScreening = () => {
|
|
enterFullscreen()
|
|
store.commit(MutationTypes.SET_SCREENING, true)
|
|
}
|
|
|
|
const enterScreeningFromStart = () => {
|
|
store.commit(MutationTypes.UPDATE_SLIDE_INDEX, 0)
|
|
enterScreening()
|
|
}
|
|
|
|
const exitScreening = () => {
|
|
store.commit(MutationTypes.SET_SCREENING, false)
|
|
if(isFullscreen()) exitFullscreen()
|
|
}
|
|
|
|
return {
|
|
enterScreening,
|
|
enterScreeningFromStart,
|
|
exitScreening,
|
|
}
|
|
} |