File tree 1 file changed +7
-8
lines changed
src/views/dashboard/admin/components/mixins
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,16 @@ import { debounce } from '@/utils'
3
3
export default {
4
4
data ( ) {
5
5
return {
6
- $_sidebarElm : null
6
+ $_sidebarElm : null ,
7
+ $_resizeHandler : null
7
8
}
8
9
} ,
9
10
mounted ( ) {
11
+ this . $_resizeHandler = debounce ( ( ) => {
12
+ if ( this . chart ) {
13
+ this . chart . resize ( )
14
+ }
15
+ } , 100 )
10
16
this . $_initResizeEvent ( )
11
17
this . $_initSidebarResizeEvent ( )
12
18
} ,
@@ -27,13 +33,6 @@ export default {
27
33
methods : {
28
34
// use $_ for mixins properties
29
35
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
30
- $_resizeHandler ( ) {
31
- return debounce ( ( ) => {
32
- if ( this . chart ) {
33
- this . chart . resize ( )
34
- }
35
- } , 100 ) ( )
36
- } ,
37
36
$_initResizeEvent ( ) {
38
37
window . addEventListener ( 'resize' , this . $_resizeHandler )
39
38
} ,
You can’t perform that action at this time.
0 commit comments