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