Created
May 23, 2024 13:19
-
-
Save asadmalik/514ec65dc854d9e49f22d82089e541ed to your computer and use it in GitHub Desktop.
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
<script setup> | |
import { useVibrate } from "@vueuse/core"; | |
// This vibrates the device for 300 ms | |
// then pauses for 100 ms before vibrating the device again for another 300 ms: | |
const { vibrate, stop, isSupported } = useVibrate({ pattern: [300, 100, 300] }); | |
// Start the vibration, it will automatically stop when the pattern is complete: | |
vibrate(); | |
// But if you want to stop it, you can: | |
stop(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment