vant 에서 시간 선택 기와 팝 업 팝 업 팝 업 팝 업 을 사용 합 니 다.
<template>
<div class="page">
<van-cell-group>
<van-cell
title=" "
:value="datetime"
arrow
@click="showDatePicker = !showDatePicker"
></van-cell>
</van-cell-group>
<van-popup v-model="showDatePicker" position="bottom" :style="{ height: '40%' }">
<van-datetime-picker
v-model="currentDate"
@confirm="
showDatePicker = false;
onchangDate1();
"
@cancel="showDatePicker = false"
title=" "
type="date"
/>
</van-popup>
</div>
<template>
<script>
import { Cell, CellGroup, DatetimePicker, Popup } from "vant";
import Vue from "vue";
export default {
// Q2 ,
components: {
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[DatetimePicker.name]: DatetimePicker,
[Popup.name]: Popup
},
//
data() {
return {
datetime: "",
currentDate: "", //
showDatePicker: false, // popup ,false
};
},
created() {
this.currentDate = new Date(); //
this.datetime = this.common.dateToString(this.currentDate); //
},
mounted() {},
methods: {
onchangDate1() {
//currentDate ,
this.datetime = this.common.dateToString(this.currentDate);
}
}
};
</script>
추가 지식:vant 의 popup,Datetimepicker 컨트롤 스크롤 관통오늘 버그 를 고치 면서 테스트 를 해 보 니 vant 의 popup 과 DatetimePicker 에 스크롤 관통 이 나타 날 것 입 니 다.
해결 방법:preventDefault 를 사용 하여 body 의 touch move 사건 을 막 습 니 다.
방법
방법
전역 에 v-roll 명령 을 등록 하고 timeDatePicker 와 결합 하여 사용 합 니 다(예 를 들 어 두 번 째 그림).body Visible 의 초기 상 태 는 false 입 니 다.탄 층 이 열 릴 때 바 뀌 고 탄 층 이 확인 을 클릭 하고 취소 할 때 도 바 뀌 어야 합 니 다!
해결 방법 은 다른 작가 의 글 링크 에서 비롯 되 었 다.
이 편 은 vant 에서 시간 선택 기와 팝 업 팝 업 팝 업 팝 업 팝 업 층 을 사용 하 는 작업 이 바로 작은 편집 이 여러분 에 게 공유 하 는 모든 내용 입 니 다.참고 하 시기 바 랍 니 다.여러분 들 도 많이 응원 해 주 셨 으 면 좋 겠 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
vant 프레임이 H5를 만들 때 밟은 구덩이를 해결(하단 리셋, 업로드 등)설명:overflow:auto를 설정했습니다.속성의 전제에서 H5 페이지는 PC 사이드 브라우저에서 위아래로 미끄러질 수 있고ios에서는 정상적으로 미끄러질 수 있으며 안드로이드 핸드폰에서는 위아래로 미끄러질 수 없...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.