<template><a-range-pickerv-model:value="dateRange":show-time="{ format: 'HH:mm:ss', // 时间部分格式defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] // 默认时间范围}"format="YYYY-MM-DD HH:mm:ss" // 整体格式:placeholder="['开始时间', '结束时间']"@change="handleDateChange"/> </template><script> import moment from 'moment';export default {data() {return {dateRange: [moment('2023-08-01 08:00:00', 'YYYY-MM-DD HH:mm:ss'), // 默认开始时间moment('2023-08-31 18:30:00', 'YYYY-MM-DD HH:mm:ss') // 默认结束时间]};},methods: {handleDateChange(dates, dateStrings) {console.log('Moment对象:', dates); // [moment, moment]console.log('格式化字符串:', dateStrings); // ['2023-08-01 08:00:00', '2023-08-31 18:30:00']}} }; </script>