feat(init): 初始化远程组件项目

This commit is contained in:
chengcheng
2025-08-19 18:15:28 +08:00
commit 611cc5c6dd
32 changed files with 13612 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
export const customTheme = {
colors: {
primary: '#4338CA',
secondary: '#03DAC6',
success: '#4CAF50',
info: '#2196F3',
warning: '#FB8C00',
error: '#FC3C56',
surface: '#FFFFFF',
background: '#F5F5F5'
}
}
+15
View File
@@ -0,0 +1,15 @@
/**
* 将URL转为blob
*
* @param url
* @constructor
*/
export const ImageUrlToBlob = async (url: string): Promise<Blob> => {
return new Promise((resolve, reject) => {
fetch(url)
.then((r) => r.blob())
.then((blob) => {
resolve(blob);
});
});
};
+9
View File
@@ -0,0 +1,9 @@
export function loadRemoteStyle(url: string) {
if (!document.getElementById(url)) {
const link = document.createElement("link");
link.id = url;
link.rel = "stylesheet";
link.href = url;
document.head.appendChild(link);
}
}