feat: 更新环境配置,添加 API 地址,优化数据获取逻辑,支持振动反馈功能
This commit is contained in:
@@ -3,14 +3,20 @@ import type { FieldBindingObject } from "vee-validate";
|
||||
|
||||
interface Props extends FieldBindingObject {
|
||||
label?: string;
|
||||
formatterValue?: (value: string) => string;
|
||||
format?: (value: string) => string;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
function handleChange(value: string) {
|
||||
const formattedValue = useDateFormat(value, "YYYY/MM/DD").value;
|
||||
const formattedValue = props.formatterValue ? props.formatterValue(value) : new Date(value).toISOString();
|
||||
props.onChange(formattedValue);
|
||||
}
|
||||
|
||||
function formatDisplay(value: string) {
|
||||
return props.format ? props.format(value) : useDateFormat(value, "YYYY/MM/DD").value;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -20,7 +26,7 @@ function handleChange(value: string) {
|
||||
</ion-label>
|
||||
<ion-datetime-button datetime="datetime" color="primary">
|
||||
<div slot="date-target">
|
||||
{{ props.value }}
|
||||
{{ formatDisplay(props.value) }}
|
||||
</div>
|
||||
</ion-datetime-button>
|
||||
<ion-modal :keep-contents-mounted="true">
|
||||
|
||||
Reference in New Issue
Block a user