【小工具封装】 uuid/
uuid
-
安装
npm i -g uuid -
引入封装
import pkg from 'uuid'; const { v4: uuidv4} = pkg; export const genUuid = () => { return uuidv4(); } -
使用
import { genUuid } from ""; const uuid = genUuid();
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
安装
npm i -g uuid
引入封装
import pkg from 'uuid';
const { v4: uuidv4} = pkg;
export const genUuid = () => {
return uuidv4();
}
使用
import { genUuid } from "";
const uuid = genUuid();