This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: jackhoo_98 <[email protected]>
- Loading branch information
1 parent
7d482e1
commit c6b8003
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
import { useFullscreen } from '@vben/utils' | ||
const domRef = ref<Nullable<HTMLElement>>(null) | ||
const { enter, toggle, exit, isFullscreen } = useFullscreen() | ||
const { toggle: toggleDom, isFullscreen: isDomFullscreen } = | ||
useFullscreen(domRef) | ||
</script> | ||
<template> | ||
<VbenCard title="全屏示例"> | ||
<VbenCard title="Window Full Screen"> | ||
<VbenButton | ||
type="primary" | ||
:disabled="isFullscreen" | ||
@click="enter" | ||
class="mr-2" | ||
> | ||
Enter Window Full Screen | ||
</VbenButton> | ||
<VbenButton type="success" @click="toggle" class="mr-2"> | ||
Toggle Window Full Screen | ||
</VbenButton> | ||
|
||
<VbenButton type="error" @click="exit" class="mr-2"> | ||
Exit Window Full Screen | ||
</VbenButton> | ||
|
||
Current State: {{ isFullscreen }} | ||
</VbenCard> | ||
|
||
<VbenCard title="Dom Full Screen"> | ||
<VbenButton type="primary" @click="toggleDom" class="mr-2"> | ||
Enter Dom Full Screen | ||
</VbenButton> | ||
</VbenCard> | ||
|
||
<div | ||
ref="domRef" | ||
class="flex items-center justify-center w-1/2 h-64 mx-auto mt-10 bg-white rounded-md" | ||
> | ||
<VbenButton type="primary" @click="toggleDom" class="mr-2"> | ||
{{ isDomFullscreen ? 'Exit Dom Full Screen' : 'Enter Dom Full Screen' }} | ||
</VbenButton> | ||
</div> | ||
</VbenCard> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters