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) {
333333 return c . length === 1 && c [ 0 ] . type === Fragment ;
334334}
335335
336+ export function isEmptyContent ( c ) {
337+ return c === undefined || c === null || c === '' || ( Array . isArray ( c ) && c . length === 0 ) ;
338+ }
339+
336340export function isEmptyElement ( c ) {
337341 return (
338342 c . type === Comment ||
Original file line number Diff line number Diff line change @@ -19,15 +19,20 @@ exports[`PageHeader pageHeader should support class 1`] = `
1919 <div
2020 class = " ant-page-header-heading"
2121 >
22- <!---->
23- <!---->
24- <span
25- class = " ant-page-header-heading-title"
22+ <div
23+ class = " ant-page-header-heading-left"
2624 >
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 >
3136 <!---->
3237 </div >
3338 <!---->
Original file line number Diff line number Diff line change 11import { defineComponent , ExtractPropTypes , ref , computed } from 'vue' ;
22import PropTypes from '../_util/vue-types' ;
3- import { flattenChildren } from '../_util/props-util' ;
3+ import { filterEmpty , flattenChildren , isEmptyContent } from '../_util/props-util' ;
44import ArrowLeftOutlined from '@ant-design/icons-vue/ArrowLeftOutlined' ;
55import ArrowRightOutlined from '@ant-design/icons-vue/ArrowRightOutlined' ;
66import Breadcrumb from '../breadcrumb' ;
@@ -39,7 +39,7 @@ const PageHeader = defineComponent({
3939 const onResize = ( { width } : { width : number } ) => {
4040 compact . value = width < 768 ;
4141 } ;
42- const ghost = computed ( ( ) => props . ghost ?? pageHeader . value ?. ghost ?? false ) ;
42+ const ghost = computed ( ( ) => props . ghost ?? pageHeader . value ?. ghost ?? true ) ;
4343
4444 const getBackIcon = ( ) => {
4545 return (
@@ -123,7 +123,10 @@ const PageHeader = defineComponent({
123123 } ;
124124
125125 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+ ) ;
127130 } ;
128131
129132 const renderChildren = ( children : any ) => {
Original file line number Diff line number Diff line change 160160 "querystring" : " ^0.2.0" ,
161161 "raw-loader" : " ^4.0.2" ,
162162 "reqwest" : " ^2.0.5" ,
163+ "resize-observer-polyfill" : " ^1.5.1" ,
163164 "rimraf" : " ^3.0.0" ,
164165 "rucksack-css" : " ^1.0.2" ,
165166 "selenium-server" : " ^3.0.1" ,
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ if (typeof window !== 'undefined') {
2323 }
2424}
2525
26+ global . ResizeObserver = require ( 'resize-observer-polyfill' ) ;
27+
2628// The built-in requestAnimationFrame and cancelAnimationFrame not working with jest.runFakeTimes()
2729// https://github.com/facebook/jest/issues/5147
2830global . requestAnimationFrame = function ( cb ) {
You can’t perform that action at this time.
0 commit comments