mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(PickerGroup): only filter Comment vnode (#12402)
This commit is contained in:
parent
c1d32e953f
commit
e2081c8890
@ -1,4 +1,9 @@
|
|||||||
import { defineComponent, type InjectionKey, type ExtractPropTypes } from 'vue';
|
import {
|
||||||
|
defineComponent,
|
||||||
|
Comment,
|
||||||
|
type InjectionKey,
|
||||||
|
type ExtractPropTypes,
|
||||||
|
} from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import {
|
import {
|
||||||
@ -71,7 +76,10 @@ export default defineComponent({
|
|||||||
const onCancel = () => emit('cancel');
|
const onCancel = () => emit('cancel');
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const childNodes = slots.default?.();
|
const childNodes = slots
|
||||||
|
.default?.()
|
||||||
|
?.filter((node) => node.type !== Comment);
|
||||||
|
|
||||||
const confirmButtonText = showNextButton()
|
const confirmButtonText = showNextButton()
|
||||||
? props.nextStepText
|
? props.nextStepText
|
||||||
: props.confirmButtonText;
|
: props.confirmButtonText;
|
||||||
|
@ -39,11 +39,13 @@ const onCancel = () => {
|
|||||||
@confirm="onConfirm"
|
@confirm="onConfirm"
|
||||||
@cancel="onCancel"
|
@cancel="onCancel"
|
||||||
>
|
>
|
||||||
|
<!-- Date -->
|
||||||
<van-date-picker
|
<van-date-picker
|
||||||
v-model="currentDate"
|
v-model="currentDate"
|
||||||
:min-date="minDate"
|
:min-date="minDate"
|
||||||
:max-date="maxDate"
|
:max-date="maxDate"
|
||||||
/>
|
/>
|
||||||
|
<!-- Time -->
|
||||||
<van-time-picker v-model="currentTime" />
|
<van-time-picker v-model="currentTime" />
|
||||||
</van-picker-group>
|
</van-picker-group>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user