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

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)
 }

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值