Skip to content

michaelxuzhi/wx-easy-calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wx-easy-calendar

简介 Introduction

  • 这是一个面向广大微信小程序开发者提供的开源日历组件;
  • This is an open-source calendar component for all WeiXin miniprogram developers;
  • 集成了基本的日历显示、日期选择、日期切换;提供暗黑模式选择的功能;
  • Including functions like basic calendar display, date selection, date switching, it also provides a dark mode selection;

上手 Prepare

  • 准备工作:初始化项目

    npm init -y
  • npm 包的安装

    npm install wx-easy-calendar -S --production
  • 允许项目使用npm模块 image-20220222001345197

  • 开始构建 image-20220222001414041

  • 等待构建完成,项目根目录下会出现miniprogram_npm文件夹,包含wx-easy-calendar的一切


使用配置 Config

  • 局部使用
    • 在需要使用的页面的 json 文件中,配置组件 image-20220222001657743)
    • key:easy-calendar 为自定义组件标签
    • value:指向npm文件夹下wx-easy-calendar组件的js文件
  • 全局使用
    • 同上,只需要在全局的app.json中配置即可

正式使用 Render

  • 在页面的 wxml 中,使用配置好的自定义标签 image-20220222002644310

  • 页面的渲染

    image-20220222002846113

    image-20220222002939341


    用法介绍 Usage

    • 正常显示当前日历
    • 点击选中日期
    • 左右滑动切换月份
    • 点击顶部左右箭头切换月份
    • 点击顶部年份/月份,精确选择日期
    • 点击[Now],回到当前日期
    • 点击[暗],切换显示模式(light/dark)

About

简单明了的微信小程序日历组件,easy-simple calendar component for wx-miniprogram

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published