美文网首页
微信小程序 - vant封装时间选择器

微信小程序 - vant封装时间选择器

作者: 西半球_ | 来源:发表于2020-07-24 16:16 被阅读0次

    demo 地址: https://github.com/iotjin/Jh_weapp

    效果图:

    JhYMDTimePicker.gif
    使用方法 :
    1. usingComponents 添加
         "JhYMTimePicker": "../../JhTools/JhYMTimePicker/JhYMTimePicker"
    
    2. wxml 添加组件
    
    <JhYMDTimePicker isShowTimePicker='{{isShowTimePicker}}' selectTime="2020-02-02" bind:onConfirm="onConfirm">
    </JhYMDTimePicker>
    
    <JhYMDTimePicker isShowTimePicker='{{isShowTimePicker2}}' selectTime="2020-06" timeType="ym" bind:onConfirm="onConfirm">
    </JhYMDTimePicker>
    
    <JhYMDTimePicker isShowTimePicker='{{isShowTimePicker3}}' selectTime="2019-03-20 18:50" timeType="all" bind:onConfirm="onConfirm">
    </JhYMDTimePicker>
    
    <JhYMDTimePicker isShowTimePicker='{{isShowTimePicker4}}' selectTime="2020-08-02" minDate="{{minDate}}" bind:onConfirm="onConfirm">
    </JhYMDTimePicker>
    
    <JhYMDTimePicker isShowTimePicker='{{isShowTimePicker5}}' selectTime="2020-02-02" maxDate="{{maxDate}}" bind:onConfirm="onConfirm">
    </JhYMDTimePicker>
    
    
    3.点击事件
      //点击选择器的 确定
      onConfirm(event) {
        let time = JhTime.Jh_timeStampToTime(event.detail, '{y}年{m}月{d}日 {h}:{i}:{s} 星期{w}');
        console.log("点击确定 选择的时间 - " + time);
      },
    
    
    

    相关文章

      网友评论

          本文标题:微信小程序 - vant封装时间选择器

          本文链接:https://www.haomeiwen.com/subject/ezvtlktx.html