微信小程序-组件封装类似picker,模态框弹出全屏和半屏,多选,单选,日期选择器
2021/7/19 17:05:26
本文主要是介绍微信小程序-组件封装类似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) }
这篇关于微信小程序-组件封装类似picker,模态框弹出全屏和半屏,多选,单选,日期选择器的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-03-30微信小程序的网络设置,及网络请求:wx.request(OBJECT)
- 2024-01-22基于taro搭建小程序多项目框架
- 2024-01-13小程序开发:在插件市场寻找步骤条组件并二开
- 2024-01-05钉钉小程序生态—企业机器人加互动卡片,改善用户体验的开始!
- 2023-12-29【UniApp】-uni-app-打包成小程序
- 2023-12-26性能翻倍!京东亿级体量小程序优化实践
- 2023-12-25小程序优化:第三方SDK过大解决方案
- 2023-11-26微信小程序文件预览和下载-文件系统
- 2023-11-2652天学习微信小程序计划No.2:注册小程序账号&安装开发者工具
- 2023-11-1952天学习微信小程序计划No.1:小程序简介