简体中文
主题
生成 UUID(v4 版本)。
import { uuid } from 'js-cool'
function uuid(): string
string - UUID 字符串。
string
uuid() // 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' uuid() // 'a1b2c3d4-e5f6-4789-a012-3456789abcde' // 作为唯一 ID 使用 const id = uuid() document.getElementById('form').id = id