File tree Expand file tree Collapse file tree 5 files changed +26
-11
lines changed Expand file tree Collapse file tree 5 files changed +26
-11
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,10 @@ export function isFragment(c) {
333
333
return c . length === 1 && c [ 0 ] . type === Fragment ;
334
334
}
335
335
336
+ export function isEmptyContent ( c ) {
337
+ return c === undefined || c === null || c === '' || ( Array . isArray ( c ) && c . length === 0 ) ;
338
+ }
339
+
336
340
export function isEmptyElement ( c ) {
337
341
return (
338
342
c . type === Comment ||
Original file line number Diff line number Diff line change @@ -19,15 +19,20 @@ exports[`PageHeader pageHeader should support class 1`] = `
19
19
<div
20
20
class = " ant-page-header-heading"
21
21
>
22
- <!---->
23
- <!---->
24
- <span
25
- class = " ant-page-header-heading-title"
22
+ <div
23
+ class = " ant-page-header-heading-left"
26
24
>
27
- Page Title
28
- </span >
29
- <!---->
30
- <!---->
25
+ <!---->
26
+ <!---->
27
+ <span
28
+ class = " ant-page-header-heading-title"
29
+ title = " Page Title"
30
+ >
31
+ Page Title
32
+ </span >
33
+ <!---->
34
+ <!---->
35
+ </div >
31
36
<!---->
32
37
</div >
33
38
<!---->
Original file line number Diff line number Diff line change 1
1
import { defineComponent , ExtractPropTypes , ref , computed } from 'vue' ;
2
2
import PropTypes from '../_util/vue-types' ;
3
- import { flattenChildren } from '../_util/props-util' ;
3
+ import { filterEmpty , flattenChildren , isEmptyContent } from '../_util/props-util' ;
4
4
import ArrowLeftOutlined from '@ant-design/icons-vue/ArrowLeftOutlined' ;
5
5
import ArrowRightOutlined from '@ant-design/icons-vue/ArrowRightOutlined' ;
6
6
import Breadcrumb from '../breadcrumb' ;
@@ -39,7 +39,7 @@ const PageHeader = defineComponent({
39
39
const onResize = ( { width } : { width : number } ) => {
40
40
compact . value = width < 768 ;
41
41
} ;
42
- const ghost = computed ( ( ) => props . ghost ?? pageHeader . value ?. ghost ?? false ) ;
42
+ const ghost = computed ( ( ) => props . ghost ?? pageHeader . value ?. ghost ?? true ) ;
43
43
44
44
const getBackIcon = ( ) => {
45
45
return (
@@ -123,7 +123,10 @@ const PageHeader = defineComponent({
123
123
} ;
124
124
125
125
const renderFooter = ( ) => {
126
- return < div class = { `${ prefixCls . value } -footer` } > { props . footer ?? slots . footer ?.( ) } </ div > ;
126
+ const footer = props . footer ?? filterEmpty ( slots . footer ?.( ) ) ;
127
+ return isEmptyContent ( footer ) ? null : (
128
+ < div class = { `${ prefixCls . value } -footer` } > { footer } </ div >
129
+ ) ;
127
130
} ;
128
131
129
132
const renderChildren = ( children : any ) => {
Original file line number Diff line number Diff line change 160
160
"querystring" : " ^0.2.0" ,
161
161
"raw-loader" : " ^4.0.2" ,
162
162
"reqwest" : " ^2.0.5" ,
163
+ "resize-observer-polyfill" : " ^1.5.1" ,
163
164
"rimraf" : " ^3.0.0" ,
164
165
"rucksack-css" : " ^1.0.2" ,
165
166
"selenium-server" : " ^3.0.1" ,
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ if (typeof window !== 'undefined') {
23
23
}
24
24
}
25
25
26
+ global . ResizeObserver = require ( 'resize-observer-polyfill' ) ;
27
+
26
28
// The built-in requestAnimationFrame and cancelAnimationFrame not working with jest.runFakeTimes()
27
29
// https://github.com/facebook/jest/issues/5147
28
30
global . requestAnimationFrame = function ( cb ) {
You can’t perform that action at this time.
0 commit comments