其他分享
首页 > 其他分享> > el-date-picker设置默认值

el-date-picker设置默认值

作者:互联网

      <el-date-picker
        v-model="value"
        type="daterange"
        @change="getdate"
        start-placeholder="开始日期"
        end-placeholder="结束日期">
      </el-date-picker>
 getdate2 () {
      this.value = []
      var vStartDate = new moment().add('month', 0).format('YYYY-MM') + '-01'
      var vEndM = moment(vStartDate).add('month', 1).add('days', -1)
      var vEndDate = moment(vEndM).format('YYYY-MM-DD')
      this.value.push(new Date(vStartDate))
      this.value.push(new Date(vEndDate))
    },

 

标签:vStartDate,el,moment,value,var,add,date,new,默认值
来源: https://www.cnblogs.com/tszr/p/16329498.html