File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change 1
1
import Vue from 'vue' ;
2
- import { isVue3 } from './constants' ;
3
2
4
3
// Fragment will be available only in Vue.js 3
5
4
const { Fragment, Comment, Text } = Vue ;
6
5
7
- function callIfNeeded ( fnOrResult , args ) {
8
- return fnOrResult instanceof Function ? fnOrResult ( args ) : fnOrResult ;
9
- }
10
-
11
6
export function isVnodeEmpty ( vnode ) {
12
7
if ( ! vnode || ( Comment && vnode . type === Comment ) ) {
13
8
return true ;
@@ -33,11 +28,7 @@ export function isVnodeEmpty(vnode) {
33
28
}
34
29
35
30
export function isSlotEmpty ( vueInstance , slot , slotArgs ) {
36
- const slotContent = isVue3
37
- ? // we need to check both $slots and $scopedSlots due to https://github.com/vuejs/core/issues/8869
38
- // additionally, in @vue/compat $slot might be a function instead of array of vnodes (sigh)
39
- callIfNeeded ( vueInstance . $slots [ slot ] || vueInstance . $scopedSlots [ slot ] , slotArgs )
40
- : vueInstance . $scopedSlots [ slot ] ?. ( slotArgs ) ;
31
+ const slotContent = vueInstance . $scopedSlots [ slot ] ?. ( slotArgs ) ;
41
32
42
33
// eslint-disable-next-line unicorn/no-array-callback-reference
43
34
return isVnodeEmpty ( slotContent ) ;
You can’t perform that action at this time.
0 commit comments