From 05a8e74672bc3ccfbf235742af4875a4662cbc4f Mon Sep 17 00:00:00 2001 From: xpyjs Date: Thu, 25 May 2023 16:09:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9Btext=20slots=20can=20not=20d?= =?UTF-8?q?isplay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useSlotsBox.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/composables/useSlotsBox.ts b/src/composables/useSlotsBox.ts index 76d68dc..7e7ac78 100644 --- a/src/composables/useSlotsBox.ts +++ b/src/composables/useSlotsBox.ts @@ -1,7 +1,6 @@ import type RowItem from '@/models/data/row'; import { useStore } from '@/store'; -import { isSymbol } from 'lodash'; -import { type Slots, type Slot } from 'vue'; +import { type Slots, type Slot, isVNode, Comment } from 'vue'; import useData from './useData'; export default () => { @@ -24,7 +23,9 @@ export default () => { if (!slots) return false; return ( - slots?.(toRowData(data))?.filter(item => !isSymbol(item.type)).length > 0 + slots?.(toRowData(data))?.filter( + item => !(isVNode(item) && item.type === Comment) + ).length > 0 ); }