File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 44
44
}
45
45
46
46
if (shouldRender) {
47
- return this .$slots .default [0 ]
47
+ return this .$slots .default ? this . $slots . default [0 ] : null
48
48
}
49
49
return null
50
50
}
Original file line number Diff line number Diff line change 44
44
}
45
45
46
46
if (shouldRender) {
47
- return this .$slots .default [0 ]
47
+ return this .$slots .default ? this . $slots . default [0 ] : null
48
48
}
49
49
return null
50
50
}
Original file line number Diff line number Diff line change 23
23
mounted () {
24
24
window .addEventListener (' resize' , this .handleResize )
25
25
this .handleResize ()
26
+ if (this .$slots .default && this .$slots .default .length > 1 ) {
27
+ console .warn (' [✋ vue-breakpoints] You may only wrap one element in a <showAt> or <hideAt/> component.' )
28
+ } else if (! this .$slots .default || this .$slots .default .length < 1 ) {
29
+ console .warn (' [✋ vue-breakpoints] You must have one child inside a <showAt> or <hideAt/> component.' )
30
+ }
26
31
},
27
32
28
33
beforeDestroy () {
You can’t perform that action at this time.
0 commit comments