element ui 时间和日期选择器的数据回显

 

效果:

 element ui 时间和日期选择器的数据回显

 

 

<template>
  <div class="custom-tree-container">
    <el-time-picker is-range v-model="value1" value-format="HH:mm:ss" range-separator="至" start-placeholder="开始时间"
      end-placeholder="结束时间" placeholder="选择时间范围">
    </el-time-picker>
    <br><br>
    <el-date-picker v-model="value2" type="daterange" range-separator="至" start-placeholder="开始日期"
      end-placeholder="结束日期">
    </el-date-picker>
  </div>
</template>

<script>
  export default {
    name: "demo",
    data() {
      return {
        value1: [],
        value2: []
      }
    },
    watch: {

    },
    created() {
      this.set();
    },
    methods: {
      set() {
        this.value1 = ['9:12:41', '14:21:38'];
        this.value2 = [new Date('2014-04-26'), new Date('2021-03-21')]
      }
    }
  };
</script>

 

上一篇:JSON schema用在哪里?????


下一篇:sql注入