Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

wepy-vimming-one-line-calendar

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wepy-vimming-one-line-calendar

wepy calendar

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

wepy-one-line-calendar

wepy calendar on-line-calendar 日历组件 单行日历组件

效果图

在线小程序码

使用

方法一

觉得样式还可以的话

/*********
* 安装
*********/
npm i wepy-one-line-calendar --save
/*********
* 使用
*********/

<template>
  <calendar></calendar>
</template>

<script>
  import wepy from 'wepy'
  import calendar from 'wepy-one-line-calendar'
    export default class Index extends wepy.page {
        components = {
          calendar: calendar
        }
    }
</script>

方法二

自己改造日历

  • 复制本项目下的src/components/calendar.wpy文件, 放到你自己的项目下。
  • calendar.wpy下面的注释写的很详细了, 遇到问题, 欢迎骚扰。

组件的emit事件, props属性, slot

emit事件

事件解释
selectDay点击日期时触发
selectMonth选择年或者月份触发
userDefineTap自定义的slot被tap时触发

props属性

属性解释
scheduleNumOfDay日期右上角标数字 [{day: '2018-12-10', num: 4}]

slot

<slot name="slot"></slot>

实例

结合emit, props, slot的实例

<template>
      <Calendar @userDefineTap.user="add" @selectDay.user="selectDay" :scheduleNumOfDay.sync="scheduleNumOfDay">
        <i class="iconfont icon-add" slot="slot"></i>
      </Calendar>
</template> 
<script>
  import wepy from 'wepy'
  import calendar from 'wepy-one-line-calendar'
    export default class Index extends wepy.page {
        components = {
          calendar: calendar
        }
        data = {
          scheduleNumOfDay: [{day: '2018-12-30', num: 5}]
        }
        methods = {
          add(){
            // slot click
          },
          selectDay(dayItem){
            // select day
          }
        }
    }
</script>     

最后

欢迎star,pr

Keywords

wepy

FAQs

Package last updated on 05 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts