File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -42,25 +42,24 @@ const BaseChart = defineComponent<
42
42
return this . $attrs
43
43
} ,
44
44
chartData ( ) {
45
- const { chart, chartRef, ...restProps } = this . attrConfig
46
- const { data } = restProps
45
+ const { data } = this . attrConfig
47
46
return data || [ ]
48
47
} ,
49
48
chartConfig ( ) {
50
- const { chart, chartRef, ...restProps } = this . attrConfig
51
- const { data, ...config } = restProps
49
+ const { chart, chartRef, data, ...config } = this . attrConfig
52
50
return config
53
51
} ,
54
52
} ,
55
53
mounted ( ) {
56
- const { chart : Chart } = this . $attrs as {
57
- chart : Plot < Options >
58
- }
54
+ const { chart : Chart , chartRef } = this . attrConfig
59
55
this . plot = new Chart ( this . $el as HTMLElement , {
60
56
data : this . chartData ,
61
57
...this . chartConfig ,
62
58
} )
63
59
this . plot . render ( )
60
+ if ( chartRef ) {
61
+ chartRef . value = this . plot
62
+ }
64
63
} ,
65
64
beforeUnmount ( ) {
66
65
/* istanbul ignore else */
You can’t perform that action at this time.
0 commit comments