vue 日期查询
作者:互联网
组件
<a-form-item label="查询日期"> <a-range-picker v-model="selectDate" @change="onChange" /> </a-form-item>
需要引入moment
import moment from 'moment'
方法
methods: { moment, onChange(dates, dateStrings) { if (!dateStrings.length) return this.selectDateStrings = dateStrings // let beginTime = dateStrings[0].replace(/-/g, '') // let endTime = dateStrings[1].replace(/-/g, '') let beginTime = dateStrings[0] let endTime = dateStrings[1] this.$set(this.queryParam, 'startDate', beginTime) this.$set(this.queryParam, 'endDate', endTime) }, }
标签:vue,日期,dateStrings,replace,moment,endTime,let,beginTime,查询 来源: https://www.cnblogs.com/sunqiaozhen/p/16409978.html