fix: make watch source correct

This commit is contained in:
Justineo
2021-02-20 15:21:53 +08:00
parent f450118a3b
commit fccd92b36d

View File

@ -104,15 +104,7 @@ export default defineComponent({
} }
} }
const { const { autoresize, manualUpdate, loading, loadingOptions } = toRefs(props);
theme,
initOptions,
group,
autoresize,
manualUpdate,
loading,
loadingOptions
} = toRefs(props);
let unwatchOption: (() => void) | null = null; let unwatchOption: (() => void) | null = null;
watch( watch(
manualUpdate, manualUpdate,
@ -151,16 +143,22 @@ export default defineComponent({
} }
); );
watch([theme, initOptions], () => { watch(
cleanup(); [() => props.theme, () => props.initOptions],
init(); () => {
}); cleanup();
init();
},
{
deep: true
}
);
watch( watch(
() => group, () => props.group,
group => { group => {
if (group && group.value && chart.value) { if (group && chart.value) {
chart.value.group = group.value; chart.value.group = group;
} }
} }
); );