From c9c5cf70a7e3b279d04d134b7660f430f8755dad Mon Sep 17 00:00:00 2001 From: shizhu Date: Wed, 5 Jun 2024 18:22:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20[=E4=BF=AE=E5=A4=8D=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8C=89=E9=92=AE=E6=97=A0=E6=B8=B2=E6=9F=93?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tour/panelRender.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/tour/panelRender.tsx b/components/tour/panelRender.tsx index 105a0dffd7..ae80cc4a93 100644 --- a/components/tour/panelRender.tsx +++ b/components/tour/panelRender.tsx @@ -119,7 +119,7 @@ const panelRender = defineComponent({ size="small" class={classNames(`${prefixCls}-prev-btn`, prevButtonProps?.className)} > - {prevButtonProps?.children ?? contextLocale.Previous} + {prevButtonProps?.children ? prevButtonProps?.children() : contextLocale.Previous} ) : null} From 6425545522b5d0841d27150867fd0559e75510d9 Mon Sep 17 00:00:00 2001 From: shizhu Date: Thu, 6 Jun 2024 14:13:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor(=E5=AE=8C=E5=96=84=20Tour=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8C=89=E9=92=AE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=81=A5=E5=A3=AE=E6=80=A7):=20=F0=9F=A6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tour/panelRender.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/tour/panelRender.tsx b/components/tour/panelRender.tsx index ae80cc4a93..b245ed4357 100644 --- a/components/tour/panelRender.tsx +++ b/components/tour/panelRender.tsx @@ -1,5 +1,6 @@ import { computed, defineComponent, toRefs } from 'vue'; import classNames from '../_util/classNames'; +import { isFunction } from '../_util/util'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import { tourStepProps } from './interface'; import type { TourBtnProps } from './interface'; @@ -119,7 +120,9 @@ const panelRender = defineComponent({ size="small" class={classNames(`${prefixCls}-prev-btn`, prevButtonProps?.className)} > - {prevButtonProps?.children ? prevButtonProps?.children() : contextLocale.Previous} + {isFunction(prevButtonProps?.children) + ? prevButtonProps.children() + : prevButtonProps?.children ?? contextLocale.Previous} ) : null}