randomUUID
Definition:
js
/**
* Generate a random UUID.
* @returns A random UUID.
* @description Generate a unique UUID using the current time and the Math.random() function.
* The UUID consists of 32 hexadecimal characters and 4 hyphens.
*/
Demo
generated random UUID -> d22b62b4-25e8-46e6-9ebe-bcc2c1390235
Usage Example
ts
import { ref } from 'vue'
import { generateUUID } from 'utils-snap-fn'
const randomUUID = ref(generateUUID())