这次给大家带来使用mint-ui时间插件时怎么获取选择值,使用mint-ui时间插件获取选择值的注意事项有哪些,下面就是实战案例,一起来看一下。
{{pickerValue}}
data () { return { pickerValue:null, 定义methods:{openPicker() { this.$refs.picker.open();设置开始 },handleConfirm(){ console.log(this.pickerValue) ;获取值},转换小时formatDate(date) { const y = date.getFullYear() let m = date.getMonth() + 1 m = m < 10 ? '0' + m : m let d = date.getDate() d = d < 10 ? ('0' + d) : d return y + ' ' + m + ' ' + d},handleConfirm(){ let a = this.pickerValue // console.log(a.split(" ")) ; this.zheng=this.formatDate(this.$refs.picker.value) console.log(this.formatDate(this.$refs.picker.value)) // console.log(this.value) ;},设置当前日期为初始日期<mt-datetime-picker :startDate="startDate"data(){ return{ startDate: new Date(), }}设置默认值this.zheng=new Date().getFullYear()+'年'+new Date().getMonth()+1+'月'+new Date().getDate()+'日
登录后复制
相信看了本文案例你已经掌握了方法,更多精彩请关注【创想鸟】其它相关文章!
推荐阅读:
使用adb shell+node.js实现抖音自动抢红包
怎样实现百度指数爬虫功能
以上就是使用mint-ui时间插件时怎么获取选择值的详细内容,更多请关注【创想鸟】其它相关文章!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。