navie ui 时间范围选择记录

159 阅读1分钟
<n-grid-item >
            <n-date-picker v-model:value="range" @update:value="handleDateChange"  start-placeholder="开始日期"  end-placeholder="结束日期"  type="datetimerange" clearable />
          </n-grid-item>
          
    
const range = ref(null)  //声明  
 range.value = null //搜索重置时
 
 //搜索条件的日期
 requestTimeStart:null,
    requestTimeEnd:null,
 //选择日期变化
 function handleDateChange(
  value,formattedValue
){
  tableData.condition.requestTimeStart = formattedValue[0];
  tableData.condition.requestTimeEnd = formattedValue[1];
}