当前位置:   article > 正文

uniapp 日期选择器_uni-app开始时间与结束时间(结束时间大于开始时间)picker编写...

uniapp 日期选择器_uni-app开始时间与结束时间(结束时间大于开始时间)picker编写...

利用uni-app官网里面picker插件代码

当点击开始时间后结束时间要大于选择后的开始时间,点击结束时间后开始时间要小于开始时间。

1、template中的代码(html)

开始时间

{ {start_date}}

结束时间

{ {other}}

2、Script中的代码export default {

data() {

const currentDate = this.getDate({

format: true

})

return {

start_date: currentDate,

end_date: currentDate,

other:'请输入'

}

},

computed: {

},

methods: {

// 选择日期

bindDateChange: function(e) {

this.start_date = e.target.value

},

bindDateChange2: function(e) {

this.end_date = e.target.value;

this.other = this.end_date;

},

// 获取当前时间

getDate(type) {

const date = new Date();

let year = date.ge

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号