Skip to content

Commit 8ee5352

Browse files
committed
docs: amend demo
1 parent a7f5070 commit 8ee5352

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

packages/hooks/pnpm-lock.yaml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
1-
21
<template>
3-
<div ref="curRef" style="background: white">
2+
<div ref="curRef">
43
<div style="margin: bottom 16px;" :style="isFullscreen ? 'Fullscreen' : 'Not fullscreen'" />
54
<div>
6-
<button type="button" @click="enterFullscreen">
5+
<vhp-button type="button" @click="enterFullscreen">
76
enterFullscreen
8-
</button>
9-
<button type="button" @click="{exitFullscreen}" style="margin:0 8px">
7+
</vhp-button>
8+
<vhp-button type="button" @click="exitFullscreen" style="margin:0 8px">
109
exitFullscreen
11-
</button>
12-
<button type="button" @click="{toggleFullscreen}">
10+
</vhp-button>
11+
<vhp-button type="button" @click="toggleFullscreen">
1312
toggleFullscreen
14-
</button>
13+
</vhp-button>
1514
</div>
1615
</div>
1716
</template>
1817

1918
<script lang="ts" setup>
20-
import { ref } from 'vue';
21-
import { useFullscreen } from 'vue-hooks-plus'
22-
23-
const curRef = ref(null);
24-
const [isFullscreen, { enterFullscreen, exitFullscreen, toggleFullscreen }] = useFullscreen(curRef);
19+
import { ref } from 'vue'
20+
import { useFullscreen } from 'vue-hooks-plus'
2521
22+
const curRef = ref(null)
23+
const [isFullscreen, { enterFullscreen, exitFullscreen, toggleFullscreen }] = useFullscreen(
24+
curRef,
25+
)
2626
</script>
27-
28-
29-
30-
31-
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<template>
2-
<div style="background:white">
2+
<div>
33
<div style="margin-bottom: 16px ">
4-
<button id="fullscreen-img" style="width: 320" alt="" />
4+
<img id="fullscreen-img" :src="img" style="width: 320px" alt="">
55
</div>
6-
<button type="button" @click="enterFullscreen">
6+
<vhp-button type="button" @click="enterFullscreen">
77
enterFullscreen
8-
</button>
8+
</vhp-button>
99
</div>
1010
</template>
1111

1212
<script lang="ts" setup>
13-
import { useFullscreen } from 'vue-hooks-plus'
13+
import { useFullscreen } from 'vue-hooks-plus'
1414
15-
const [, { enterFullscreen }] = useFullscreen(() => document.getElementById('fullscreen-img'));
15+
const img = 'https://v2.cn.vuejs.org/images/logo.svg'
1616
17+
const [, { enterFullscreen }] = useFullscreen(() => document.getElementById('fullscreen-img'))
1718
</script>

0 commit comments

Comments
 (0)