diff --git a/packages/vant/src/picker-group/PickerGroup.tsx b/packages/vant/src/picker-group/PickerGroup.tsx index 97ef3a492..74bfac095 100644 --- a/packages/vant/src/picker-group/PickerGroup.tsx +++ b/packages/vant/src/picker-group/PickerGroup.tsx @@ -1,4 +1,9 @@ -import { defineComponent, type InjectionKey, type ExtractPropTypes } from 'vue'; +import { + defineComponent, + Comment, + type InjectionKey, + type ExtractPropTypes, +} from 'vue'; // Utils import { @@ -71,7 +76,10 @@ export default defineComponent({ const onCancel = () => emit('cancel'); return () => { - const childNodes = slots.default?.(); + const childNodes = slots + .default?.() + ?.filter((node) => node.type !== Comment); + const confirmButtonText = showNextButton() ? props.nextStepText : props.confirmButtonText; diff --git a/packages/vant/src/picker-group/demo/SelectDateTime.vue b/packages/vant/src/picker-group/demo/SelectDateTime.vue index 93def66bf..30d27c855 100644 --- a/packages/vant/src/picker-group/demo/SelectDateTime.vue +++ b/packages/vant/src/picker-group/demo/SelectDateTime.vue @@ -39,11 +39,13 @@ const onCancel = () => { @confirm="onConfirm" @cancel="onCancel" > + +