npm install -S uuid import { v4 } from 'uuid' this.uuId = v4()
1.安装nanoid库 npm i nanoid 2.引入nanoid import {nanoid} from 'nanoid' 3.调用生成随机id nanoid()