@@ -3,7 +3,7 @@ import { computed, defineComponent, ref } from 'vue';
3
3
import Tooltip from '../tooltip' ;
4
4
import abstractTooltipProps from '../tooltip/abstractTooltipProps' ;
5
5
import PropTypes from '../_util/vue-types' ;
6
- import { initDefaultProps } from '../_util/props-util' ;
6
+ import { filterEmpty , initDefaultProps } from '../_util/props-util' ;
7
7
import { withInstall } from '../_util/type' ;
8
8
import useConfigInject from '../_util/hooks/useConfigInject' ;
9
9
import omit from '../_util/omit' ;
@@ -39,10 +39,14 @@ const Popover = defineComponent({
39
39
const { prefixCls, configProvider } = useConfigInject ( 'popover' , props ) ;
40
40
const rootPrefixCls = computed ( ( ) => configProvider . getPrefixCls ( ) ) ;
41
41
const getOverlay = ( ) => {
42
- const { title = slots . title ?.( ) , content = slots . content ?.( ) } = props ;
42
+ const { title = filterEmpty ( slots . title ?.( ) ) , content = filterEmpty ( slots . content ?.( ) ) } =
43
+ props ;
44
+ const hasTitle = ! ! ( Array . isArray ( title ) ? title . length : title ) ;
45
+ const hasContent = ! ! ( Array . isArray ( content ) ? content . length : title ) ;
46
+ if ( ! hasTitle && ! hasContent ) return undefined ;
43
47
return (
44
48
< >
45
- { title && < div class = { `${ prefixCls . value } -title` } > { title } </ div > }
49
+ { hasTitle && < div class = { `${ prefixCls . value } -title` } > { title } </ div > }
46
50
< div class = { `${ prefixCls . value } -inner-content` } > { content } </ div >
47
51
</ >
48
52
) ;
0 commit comments