feat: add full screen in area feature (#30)

This commit is contained in:
Sunny-117
2022-11-12 10:17:05 +08:00
committed by GitHub
parent 907dc21d55
commit 9557c5679e
2 changed files with 36 additions and 2 deletions

View File

@@ -3,17 +3,25 @@ import { ref, onUnmounted } from "vue"
import { ElMessage } from "element-plus"
import screenfull from "screenfull"
const props = defineProps({
areaScreenFull: {
type: Boolean,
required: false
}
})
type contentType = "全屏" | "退出全屏"
const content = ref<contentType>("全屏")
const isFullscreen = ref(false)
const click = () => {
const element = document.querySelector(".app-container") || undefined
if (!screenfull.isEnabled) {
ElMessage.warning("您的浏览器无法工作")
return
}
screenfull.toggle()
screenfull.toggle(props.areaScreenFull ? element : undefined)
}
const change = () => {