Skip to content

Commit

Permalink
feat: fix calendar confirmBtn when value is null
Browse files Browse the repository at this point in the history
  • Loading branch information
GaoJiuJiu committed Oct 15, 2024
1 parent 88e15da commit 966b60a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/calendar/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,20 @@ export default defineComponent({
return () => {
const title = renderTNodeJSX('title');
const confirmBtn = renderTNodeJSX('confirmBtn');
let newConfirmBtn = confirmBtn;
if (typeof confirmBtn === 'undefined') {
newConfirmBtn = null;
}
return (
<div>
{!props.usePopup ? (
<calendarTemplate ref={calendarTemplateRef} title={title} confirmBtn={confirmBtn}></calendarTemplate>
<calendarTemplate ref={calendarTemplateRef} title={title} confirmBtn={newConfirmBtn}></calendarTemplate>
) : (
<t-popup visible={props.visible} placement="bottom" onVisibleChange={onPopupVisibleChange}>
<calendarTemplate
ref={calendarTemplateRef}
title={title}
confirmBtn={confirmBtn}
confirmBtn={newConfirmBtn}
onVisibleChange={onVisibleChange}
></calendarTemplate>
</t-popup>
Expand Down

0 comments on commit 966b60a

Please sign in to comment.