bugfix: 修复H5日期组件返回的值缺少秒的问题
This commit is contained in:
parent
80909dfd4d
commit
2d3253ba0e
@ -55,6 +55,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { Field, Popup, DatePicker, TimePicker } from 'vant'
|
||||
import { formatDate } from '@shared/utils'
|
||||
|
||||
// Props 定义
|
||||
const props = defineProps({
|
||||
@ -141,6 +142,11 @@ const props = defineProps({
|
||||
return option
|
||||
}
|
||||
},
|
||||
// 返回结果格式化
|
||||
resultFormat: {
|
||||
type: String,
|
||||
default: 'YYYY-MM-DD HH:mm:ss'
|
||||
},
|
||||
// 选项过滤函数
|
||||
filter: {
|
||||
type: Function,
|
||||
@ -350,7 +356,6 @@ const formatTimePart = () => {
|
||||
// 确认选择
|
||||
const onConfirm = () => {
|
||||
let finalValue = formatDatePart()
|
||||
|
||||
if (hasTime.value) {
|
||||
const timePart = formatTimePart()
|
||||
if (timePart) {
|
||||
@ -358,6 +363,8 @@ const onConfirm = () => {
|
||||
}
|
||||
}
|
||||
|
||||
finalValue = formatDate(finalValue)
|
||||
|
||||
emit('update:modelValue', finalValue)
|
||||
emit('change', finalValue)
|
||||
showPicker.value = false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user