feat: dynamically update the theme (#841)

Co-authored-by: GU Yiling <justice360@gmail.com>
This commit is contained in:
Yue JIN
2025-07-02 18:32:50 +08:00
committed by GU Yiling
parent 55c187ec64
commit 26c991ea81
6 changed files with 44 additions and 21 deletions

View File

@ -252,7 +252,7 @@ export default defineComponent({
);
watch(
[realTheme, realInitOptions],
realInitOptions,
() => {
cleanup();
init();
@ -262,6 +262,16 @@ export default defineComponent({
},
);
watch(
realTheme,
(theme) => {
chart.value?.setTheme(theme);
},
{
deep: true,
},
);
watchEffect(() => {
if (props.group && chart.value) {
chart.value.group = props.group;