Wepy Calendar Save

微信小程序/wepy/日历组件

Project README

wepy-canlendar


一款微信小程序的日历组件 支持左右翻页,picker.

Screenshots

日期选择器

日期选择器

日期选择器

Usage

首先记得把asset/icons下的2个小图标放到自己的资源文件里哦

项目依赖moment

cnpm install moment --save

代码全部有注释,使用上有问题请在github联系我,欢迎pr

import calendar from '../components/calendar

<calendar :visible.sync="calendarVisible"  :value.sync="time" @hanleConfirm.user="hanleConfirm" color="#05c8d3"></calendar>
  data = {
    calendarVisible: false,
    time: '2018-04-11'
  }
  components = {
    calendar
  }
  methods = {
    showcalendar () {
      this.calendarVisible = true
    },
    hanleConfirm (e) {
      console.log(e)// 导出数据
    }
  }


最后导出的数据很友好:

// 导出一个object
{
    day:27,
    formatDay:'2018-05-27',
    month:5,
    weekCh:'周日',
    year: 2018
}

API

wepy-calendar props

name type default description
visible Boolean false 控制dialog的显示
value String(YYYY-MM-DD) moment().format('YYYY-MM-DD') 日历初始值
hanleConfirm.user 自定义事件 必填 点击确定按钮触发的钩子
color rgb rgba等(css里的颜色值都可用) black 日历主色

License

wepy-calendar is released under the MIT license.

Open Source Agenda is not affiliated with "Wepy Calendar" Project. README Source: KingJeason/wepy-calendar
Stars
67
Open Issues
1
Last Commit
6 years ago

Open Source Agenda Badge

Open Source Agenda Rating