perf: 优化大屏的背景渲染方式,提升性能

This commit is contained in:
MTrun
2022-02-10 16:34:34 +08:00
parent 902145df71
commit 7747ac07ed
4 changed files with 25 additions and 150 deletions
+9
View File
@@ -100,6 +100,15 @@ export const isMac = () => {
return /macintosh|mac os x/i.test(navigator.userAgent)
}
/**
* * file转url
*/
export const fileToUrl = (file:File): string => {
const Url = URL || window.URL || window.webkitURL;
const ImageUrl = Url.createObjectURL(file);
return ImageUrl
};
/**
* * file转base64
*/