Skip to content

Commit 66c7766

Browse files
authored
Merge pull request #4313 from VisActor/fix/fix-theme-demo-fetch
fix: fix bug of vchar theme demo
2 parents 0dfbe80 + 4002b5d commit 66c7766

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

docs/assets/examples/en/theme/theme-switch.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,8 @@ const spec = {
193193
]
194194
};
195195

196-
const getNewTheme = async () => {
197-
const theme = // your custom theme
198-
(
199-
await import('https://www.unpkg.com/@visactor/vchart-theme@latest/public/dark.json', {
200-
assert: { type: 'json' }
201-
})
202-
).default;
203-
return theme;
204-
};
205-
206-
const newTheme = await getNewTheme();
196+
const response = await fetch('https://www.unpkg.com/@visactor/vchart-theme@latest/public/dark.json');
197+
const newTheme = await response.json();
207198

208199
// 注册主题
209200
VChart.ThemeManager.registerTheme('user', newTheme);

docs/assets/examples/zh/theme/theme-switch.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,8 @@ const spec = {
194194
]
195195
};
196196

197-
const getNewTheme = async () => {
198-
const theme = // your custom theme
199-
(
200-
await import('https://www.unpkg.com/@visactor/vchart-theme@latest/public/dark.json', {
201-
assert: { type: 'json' }
202-
})
203-
).default;
204-
return theme;
205-
};
206-
207-
const newTheme = await getNewTheme();
197+
const response = await fetch('https://www.unpkg.com/@visactor/vchart-theme@latest/public/dark.json');
198+
const newTheme = await response.json();
208199

209200
// 注册主题
210201
VChart.ThemeManager.registerTheme('user', newTheme);

0 commit comments

Comments
 (0)