安装snowflake-id插件
npm i snowflake-id
页面导入雪花插件
import SnowflakeId from "snowflake-id";
方法内使用雪花算法
const snowflake = new SnowflakeId(); let id = snowflake.generate(); console.log(id);
标签:uniapp,插件,Vue,雪花,snowflake,算法,id,ID From: https://www.cnblogs.com/Intellectualscholar/p/16609026.html