赞
踩
利用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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。