File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -42,25 +42,24 @@ const BaseChart = defineComponent<
4242 return this . $attrs
4343 } ,
4444 chartData ( ) {
45- const { chart, chartRef, ...restProps } = this . attrConfig
46- const { data } = restProps
45+ const { data } = this . attrConfig
4746 return data || [ ]
4847 } ,
4948 chartConfig ( ) {
50- const { chart, chartRef, ...restProps } = this . attrConfig
51- const { data, ...config } = restProps
49+ const { chart, chartRef, data, ...config } = this . attrConfig
5250 return config
5351 } ,
5452 } ,
5553 mounted ( ) {
56- const { chart : Chart } = this . $attrs as {
57- chart : Plot < Options >
58- }
54+ const { chart : Chart , chartRef } = this . attrConfig
5955 this . plot = new Chart ( this . $el as HTMLElement , {
6056 data : this . chartData ,
6157 ...this . chartConfig ,
6258 } )
6359 this . plot . render ( )
60+ if ( chartRef ) {
61+ chartRef . value = this . plot
62+ }
6463 } ,
6564 beforeUnmount ( ) {
6665 /* istanbul ignore else */
You can’t perform that action at this time.
0 commit comments