Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9725bf2

Browse files
docs(useVibrate): add demo for useVibrate with support check and controls (#4882)
Co-authored-by: 远方os <[email protected]>
1 parent e059c4a commit 9725bf2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

packages/core/useVibrate/demo.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<script setup lang="ts">
2+
import { useVibrate } from './index'
3+
4+
const {
5+
isSupported,
6+
vibrate,
7+
stop,
8+
} = useVibrate()
9+
</script>
10+
11+
<template>
12+
<div class="grid grid-cols-1 gap-x-4 gap-y-4">
13+
<div>{{ isSupported ? 'Vibration API Supported' : 'Your browser does not support the Vibration API' }}</div>
14+
15+
<div v-if="isSupported">
16+
<button @click="vibrate()">
17+
Vibrate
18+
</button>
19+
20+
<button @click="stop()">
21+
Stop
22+
</button>
23+
</div>
24+
</div>
25+
</template>

0 commit comments

Comments
 (0)