<template>
<input type="date" id="dateInput" @change="formatDateInput()">
</template>
// 2023/10/16 => 2023-10-16
formatDateInput() {
const dateInput = document.getElementById("dateInput");
const selectedDate = dateInput.value;
const formattedDate = new Date(selectedDate).toISOString().split('T')[0];
dateInput.value = formattedDate;
}
日期格式转换
博客未提供具体内容,推测与JavaScript相关。JavaScript是前端开发常用语言,可用于实现网页交互等功能。

被折叠的 条评论
为什么被折叠?



