vmodel-calendar
v0.0.5
Published
实现初始化的微信小程序日历
Downloads
8
Maintainers
Readme
vmodel-calendar
实现初始化的微信小程序日历选择器,用于用户自定义场景。
只是用来自己学习使用
使用
- 安装 vmodel-calendar
npm install --save vmodel-calendar
- 在需要使用 calendar 的页面 page.json 中添加 calendar 自定义组件配置
{
"usingComponents": {
"calendar": "vmodel-calendar/calendar"
}
}
- 在 wxml 中使用
<view bindtap="showCalendar">选择日期:{{date}}</view>
<calendar wx:if="{{showCalendar}}" start="2019-12-05" end="2021-05-18" value="{{date}}" bind:doChange="_doChange" bind:doClose="_doClose"></calendar>
vmodel-calendar 的属性介绍如下:
| 属性名 | 类型 | 默认值 | 是否必须 | 说明 | | -------------- | ------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | start / end | String | '2019-12-05' | 否 | 开始/结束日期 | | | value | String | '' | 否 | 当前的值 | |
事件:
| 事件名 | 说明 | | ------ | ---------------- | | doChange | 选中日期时触发 | | doClose | 关闭选择器 |