|
@@ -7,12 +7,22 @@ export function registerTheme() {
|
|
fetch((cdn ? cdn + '/v/' : '') + 'theme/dark.json')
|
|
fetch((cdn ? cdn + '/v/' : '') + 'theme/dark.json')
|
|
.then((r) => r.json())
|
|
.then((r) => r.json())
|
|
.then((theme) => {
|
|
.then((theme) => {
|
|
- echarts.registerTheme('le-dark', theme);
|
|
|
|
|
|
+ const timer = setInterval(() => {
|
|
|
|
+ if (echarts) {
|
|
|
|
+ echarts.registerTheme('le-dark', theme);
|
|
|
|
+ clearInterval(timer);
|
|
|
|
+ }
|
|
|
|
+ }, 200);
|
|
});
|
|
});
|
|
fetch((cdn ? cdn + '/v/' : '') + 'theme/light.json')
|
|
fetch((cdn ? cdn + '/v/' : '') + 'theme/light.json')
|
|
.then((r) => r.json())
|
|
.then((r) => r.json())
|
|
.then((theme) => {
|
|
.then((theme) => {
|
|
- echarts.registerTheme('le-light', theme);
|
|
|
|
|
|
+ const timer = setInterval(() => {
|
|
|
|
+ if (echarts) {
|
|
|
|
+ echarts.registerTheme('le-light', theme);
|
|
|
|
+ clearInterval(timer);
|
|
|
|
+ }
|
|
|
|
+ }, 200);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|