无法重新填充 vue2-daterange 选择器值

Not able to re-populate back vue2-daterange picker value

嗨,我确实有现有的值要为数据范围选择器填充回来

对于单个日期范围选择器它适用于多个它不工作

这是我试过的方法

问题: 范围不工作甚至格式 DD-MM-YYYY 不工作

Vue.use(DatePicker.default); // don't worry about this, it's just for the demo
new Vue({
  el: '#app',
   data () {
    return {
      date1:['10-07-2021'],
      date2:['10-07-2021','18-07-2021'],
    }
  }
})
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue2-datepicker@1.9.7/dist/build.min.js"></script>
<script src="https://momentjs.com/downloads/moment.js"></script>

<div id="app">
 <date-picker v-model="date1" lang="en" format="DD-MM-YYYY"></date-picker>
  <date-picker v-model="date2" :range="Boolean(true)" format="DD-MM-YYYY" lang="en" ></date-picker>
</div>

请帮助我提前谢谢!!!

日期选择器采用标准 javascript 日期格式。因此必须首先将日期转换为兼容格式,例如YYYY-MM-DD 或 MM/DD/YYYY。更多信息可以参考https://www.w3schools.com/js/js_date_formats.asp

Vue.use(DatePicker.default); // don't worry about this, it's just for the demo
new Vue({
  el: '#app',
  data() {
    return {
      date1: ['07-10-2021'],
      date2: ['07-10-2021', '07-18-2021']
    }
  }
})
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue2-datepicker@1.9.7/dist/build.min.js"></script>
<script src="https://momentjs.com/downloads/moment.js"></script>

<div id="app">
  <date-picker v-model="date1" lang="en" format="DD-MM-YYYY"></date-picker>
  <date-picker v-model="date2" :range="Boolean(true)" format="DD-MM-YYYY" lang="en"></date-picker>
</div>