ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

微信小程序-组件封装类似picker,模态框弹出全屏和半屏,多选,单选,日期选择器

2021-07-19 16:59:50  阅读:186  来源: 互联网

标签:picker 00 日历 选中 getCurDomeDate date 单选 选择器


https://github.com/han-guang-xue/WX-Dialog(转)
将上述的链接下Dialog中的组件引入即可使用
以下是使用案例,配置好组件路径,拷贝到页面使用即可

<view class="text_1" style="width:100rpx;height:200rpx;background:#000;">
  <dialog type="singleRow" isFull="false" methodSuccess="evenP" bindevenP="getCurDomeDate" 
    lableTitle="选择标签页标题" default_value="4天" otherData="1天,2天,3天,4天,5天">
    <view style="width:500rpx;height:100rpx;background:#cdcdcd;">单列表滚动 点我</view>
  </dialog>
</view>


<dialog type="date" isFull="false" methodSuccess="evenP" bindevenP="getCurDomeDate" >
  <view class="form_select_value">
    <view style="width:500rpx;height:100rpx;background:#CDCDCD;">日历插件(date) 点我</view>
  </view>
</dialog>

<dialog type="date" isFull="false" methodSuccess="evenP" bindevenP="getCurDomeDate" default_value="2020-03-05">
  <view class="form_select_value">
    <view style="width:500rpx;height:100rpx;background:#CDCDCD;margin-top:10rpx">日历 默认选中时间(date) 点我
      <view>2020-03-05(选中特定日期)</view>
    </view>
  </view>
</dialog>

<dialog type="date" isFull="false" methodSuccess="evenP" bindevenP="getCurDomeDate" default_value="2020-04-00">
  <view class="form_select_value">
    <view style="width:500rpx;height:100rpx;background:#CDCDCD;margin-top:10rpx">日历 默认选中时间(date) 点我
      <view>2020-03-00(选中特定月份)</view>
    </view>
  </view>
</dialog>


<dialog type="date" isFull="false" methodSuccess="evenP" bindevenP="getCurDomeDate" default_value="2020-00-00">
  <view class="form_select_value">
    <view style="width:500rpx;height:100rpx;background:#CDCDCD;margin-top:10rpx">日历 默认选中时间(date) 点我
      <view>2020-00-00(选中特定年)</view>
    </view>
  </view>
</dialog>




<dialog type="radio" isFull="true" methodSuccess="evenP" bindevenP="getCurDomeDate1" multiSelect="N"
  otherData="good,nice,veryNice" default_value="nice">
   <view style="width:500rpx;height:100rpx;background:#CDCDCD;margin-top:30rpx;">单选</view>
</dialog>


<dialog type="radio" isFull="true" methodSuccess="evenP" bindevenP="getCurDomeDate1" multiSelect="Y"
  otherData="good,nice,veryNice" default_value="nice">
   <view style="width:500rpx;height:100rpx;background:#CDCDCD;margin-top:30rpx;">多选 (相比单选只需要修改参数multiSelect)</view>
</dialog>

注 bindevenP 指定的getCurDomeDate函数需要在引用到的js文件中自定义

bindevenP="getCurDomeDate"
  getCurDomeDate:function(e){
   console.log(e)
   console.log("返回数据:" + e.detail)
 }

在这里插入图片描述
在这里插入图片描述

标签:picker,00,日历,选中,getCurDomeDate,date,单选,选择器
来源: https://blog.csdn.net/weixin_46856618/article/details/118901549

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有