1.1.1 • Published 4 years ago

vue-calendar-xjq v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

安装

npm安装

npm install vue-calendar-xjq --save

yarn安装

yarn add vue-calendar-xjq

CDN

<!-- 引入样式 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vue-calendar-xjq@1.1.0/dist/index.css">
<!-- 引入组件 -->
<script src="https://cdn.jsdelivr.net/npm/vue-calendar-xjq@1.1.0/dist/index.js"></script>

快速上手

import Vue from 'vue';
import Calendar from 'vue-calendar-xjq';
import 'vue-calendar-xjq/lib/index.css';

Vue.use(Calendar)

Attributes

参数说明类型默认值
el绑定的元素的idstring
value/v-model是否显示组件booleanfalse
isLunar是否显示农历booleanfalse
hms是否添加时间输入booleanfalse
minDate允许的最小日期 (格式:yyyy-MM-DD)string
maxDate允许的最大日期 (格式:yyyy-MM-DD)string
defaultVal默认值string
format格式化stringyyyy-MM-DD

Events

事件名称说明回调参数
change选择日期后触发{ date: 17, day: 3, formatDate: "2018年01月17日 下午 02:05:15", hour: "14", minute: "5", month: 0, second: "15", year: 2018 }

日期格式

格式含义备注举例
yy取年份后两位19
yyyy2019
M月份不补01
MM月份补001
D不补01
DD补001
d
dd周一
ddd星期一
A上午
h小时12小时制,不补0, 需要和 A 配合使用1
hh小时12小时制,补0,需要和A配合使用01
H小时24小时制,不补015
HH小时24小时制,补004
m分钟不补01
mm分钟补001
s不补01
ss补001
LY农历年2018
LM农历月份腊月
LD农历日十一
LT农历节气没有节气的话,则是空字符串冬至

自定义样式

步骤一:引入样式

import 'vue-calendar-xjq/lib/index.less'

步骤二:修改样式变量

// 使用Less提供的modifyVars即可对变量进行修改, 下面是webpack的配置
module.exports = {
  rules: [
    {
      test: /\.less$/,
      use: [
        // ...其他 loader 配置
        {
          loader: 'less-loader',
          options: {
            modifyVars: {
              'primary-color': '#22c39b',
            }
          }
        }
      ]
    }
  ]
};

样式变量

其它样式变量,请参考配置文件

截图

截图1 截图2

1.1.1

4 years ago

1.1.0

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago