移动端mintUI mt-datetime-picker 组件使用详解

<mt-datetime-picker
           v-model="pickerVisible"   //绑定的数据值
           ref="pickerData"             // 点击触发的dom节点
           type="date"                    // 可设置多种格式
           year-format="{value} 年"
           month-format="{value} 月"
           date-format="{value} 日"
           @confirm="handleConfirm"    // 带确定和取消顶栏
           :startDate="startDate"           // 可设置开始时间为今天
         >
         </mt-datetime-picker>

data(){
        pickerVisible:'',
        startDate:new Date(),
        time:''
}

methods:{
      rentInformat(){
         this.$router.push('/rentInformation')
      },
      dataClick(){
        this.$refs.pickerData.open();   // 触发
// this.$refs.pickerData.close() ; // 关闭 }, handleConfirm(val){ console.log(val,
this.pickerVisible) this.time = val ; } }

猜你喜欢

转载自www.cnblogs.com/panax/p/10932595.html