From 966b60a956c970f69b26c4e0f516c5d72a025228 Mon Sep 17 00:00:00 2001
From: jiushugao <929226915@qq.com>
Date: Tue, 15 Oct 2024 23:24:26 +0800
Subject: [PATCH 1/2] feat: fix calendar confirmBtn when value is null
---
src/calendar/calendar.tsx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/calendar/calendar.tsx b/src/calendar/calendar.tsx
index 5b7f9b1e8..b0f8f324c 100644
--- a/src/calendar/calendar.tsx
+++ b/src/calendar/calendar.tsx
@@ -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 (
{!props.usePopup ? (
-
+
) : (
From 91deb07787b448668e9abd0226deeacbd28e2d71 Mon Sep 17 00:00:00 2001
From: anlyyao
Date: Wed, 16 Oct 2024 15:22:43 +0800
Subject: [PATCH 2/2] chore: simplify
---
src/calendar/calendar.tsx | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/calendar/calendar.tsx b/src/calendar/calendar.tsx
index b0f8f324c..c777ab121 100644
--- a/src/calendar/calendar.tsx
+++ b/src/calendar/calendar.tsx
@@ -61,21 +61,17 @@ export default defineComponent({
return () => {
const title = renderTNodeJSX('title');
- const confirmBtn = renderTNodeJSX('confirmBtn');
- let newConfirmBtn = confirmBtn;
- if (typeof confirmBtn === 'undefined') {
- newConfirmBtn = null;
- }
+ const confirmBtn = renderTNodeJSX('confirmBtn') === undefined ? null : renderTNodeJSX('confirmBtn');
return (
{!props.usePopup ? (
-
+
) : (