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 4444 }
4545
4646 if (shouldRender) {
47- return this .$slots .default [0 ]
47+ return this .$slots .default ? this . $slots . default [0 ] : null
4848 }
4949 return null
5050 }
Original file line number Diff line number Diff line change 4444 }
4545
4646 if (shouldRender) {
47- return this .$slots .default [0 ]
47+ return this .$slots .default ? this . $slots . default [0 ] : null
4848 }
4949 return null
5050 }
Original file line number Diff line number Diff line change 2323 mounted () {
2424 window .addEventListener (' resize' , this .handleResize )
2525 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+ }
2631 },
2732
2833 beforeDestroy () {
You can’t perform that action at this time.
0 commit comments