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 -> c5d806d4-1a88-4301-9708-04ed4ef7d4e3
Usage Example
ts
import { ref } from 'vue'
import { generateUUID } from 'utils-snap-fn'
const randomUUID = ref(generateUUID())