小程序极点日历插件

1、配置

极点日历,插件信息,AppID: wx92c68dae5a8bb046,版本号:1.1.0
微信公众平台登录小程序,设置–第三方设置–添加插件–搜索插件(wx92c68dae5a8bb046)并申请授权

2、app.json

"plugins": {
    "calendar": {
      "version": "1.1.0",
      "provider": "wx92c68dae5a8bb046"
    }
  }

3、引用

在需要使用到该插件的小程序页面的 JSON 配置文件中,做以下配置

{
  "usingComponents": {
    "calendar": "plugin://calendar/calendar"
  }
}

4、wxml

<calendar 
  calendar-style="calendar" header-style="header" board-style="board" 
  weeks-type="cn" next="{{ true }}" prev="{{ true }}" show-more-days="{{ true }}" 
  days-color="{{ days_style }}" lunar="{{ true }}" cell-size="40"
  binddayClick="dayClick" />

5、js

data: {
  days_style: [
    {month: 'current', day: 12, color: 'white', background: '#b49eeb'},
    {month: 'current', day: 17, color: 'white', background: '#f5a8f0'},
    {month: 'current', day :20, color: 'white', background: '#aad4f5'},
    {month: 'current', day :25, color: 'white', background: '#84e7d0'},
  ]
},

// 方法
dayClick (event) {
    console.log('event ===> ', event)
},

6、wxss

.calendar {
    background-color: white;  /*背景色为白色*/
    padding-top: 10rpx;       /*上内边距为 10px*/
    border-radius: 15rpx;     /*添加边框圆角*/
}
.header {
    font-size: large;
    color: #59518d;
}
.board {
    color: #c7cbe2;
    font-weight: bold;
}

7、注释

calendar-style=“calendar” ,类名
header-style=“header” ,类名
board-style=“board”,类名
header,Boolean,true,是否显示标题
next,Boolean,true,是否显示下个月按钮
prev,Boolean,true,是否显示上个月按钮
show-more-days,Boolean,false,是否显示非当前月的日期
weeks,Boolean,true,是否显示周标题
weeks-type,String,en英文,cn中文,周标题类型
days-color,Array[],设置各日期字体颜色、背景颜色
cell-size,Number,30,设置日期单元格大小
active-type,String,rounded,设置日期背景形状
lunar,Boolean,false,是否显示农历

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值