Skip to content

Commit eefcfa3

Browse files
authoredJul 7, 2023
Use nextTick to apply chart props change (#1045)
* Use nextTick to apply chart props change Related to #1043 * Add nextTick import
1 parent 884abdc commit eefcfa3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/chart.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
onMounted,
77
onBeforeUnmount,
88
watch,
9-
toRaw
9+
toRaw,
10+
nextTick
1011
} from 'vue'
1112
import { Chart as ChartJS } from 'chart.js'
1213
import type { ChartComponent } from './types.js'
@@ -102,7 +103,9 @@ export const Chart = defineComponent({
102103
}
103104

104105
if (shouldUpdate) {
105-
update(chart)
106+
nextTick(() => {
107+
update(chart)
108+
})
106109
}
107110
},
108111
{ deep: true }

0 commit comments

Comments
 (0)
Please sign in to comment.