export const uuid = () => { const temp_url = URL.createObjectURL(new Blob()) const uuid = temp_url.toString() URL.revokeObjectURL(temp_url) //释放这个url return uuid.substring(uuid.lastIndexOf('/') + 1) }
示例:
uuid() // a640be34-689f-4b98-be77-e3972f9bffdd
标签:const,uuid,temp,url,前端,URL,id From: https://www.cnblogs.com/Jishuyang/p/17073195.html