zmc
2023-12-22 c7e4dd9bd50cf6e6426598753c796ec1a27f333f
src/sfc/TimeSelect.vue
@@ -34,7 +34,7 @@
  methods:{
    initOneWeekAgoTime(){
      // 给时间选择器设置默认时间为一周前
    this.time[0] = dayjs().subtract(2, 'week').format('YYYY-MM-DD HH:mm:ss');
    this.time[0] = dayjs().subtract(4, 'week').format('YYYY-MM-DD HH:mm:ss');
    this.time[1] = dayjs().format('YYYY-MM-DD HH:mm:ss');
    }
  }
@@ -48,10 +48,12 @@
    <el-date-picker
      v-model="time"
      type="datetimerange"
      range-separator="To"
      range-separator="~"
      start-placeholder="Start date"
      end-placeholder="End date"
      @change="$emit('submitTime', time)"
      class="pick-date"
    />
  </div>
</template>
@@ -61,5 +63,16 @@
  margin-left: 30px;
  margin-top: 5px;
  font-weight: bold;
  white-space: nowrap;
}
.block {
  display: flex;
  justify-content: center;
  /* width: 50%; */
  white-space: nowrap;
}
.pick-date {
  width: 100%;
}
</style>