1.1.1 • Published 3 years ago

wm-date-picker-ui v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

wm-calendar-panel

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Customize configuration

See Configuration Reference.

Install

npm i wm-date-picker-ui -S

Quick Start

import Vue from 'vue'
import 'wm-date-picker-ui/datePicker-ui.css'
import Datepicker from 'wm-date-picker-ui'

Vue.use(Datepicker)

API

参数说明类型默认值
initDate初始化日期String/Date当天
dateOptions日历多选数据项配置Object-
readonly只读Booleanfalse
isShowTitle是否展示日历标题Booleantrue
isRadio是否为单选Booleantrue
isRange是否为范围选中(isRadio为false时,有效)Booleanfalse
leftTip日期左上角文字提示(isRadio为false时,有效)String''
rightTip日期右上角文字提示(isRadio为false时,有效)String''
startText范围选择时,开始位置-日期底部提示(isRadio为false且isRange为true时,有效)String开始
endText范围选择时,结束位置-日期底部提示(isRadio为false且isRange为true时,有效)String结束
middleText范围选择时,开始和结束位置相同-日期底部提示(isRadio为false且isRange为true时,有效)String始/终
radioList单选和多选时非范围选择的列表数据dateOptionsType[][]
checkList多选时范围选择的列表数据Array<dateOptionsType[]>[]
lunarCalendar设置农历节假日Object{'0101':'春节'}{}
gregCalendar设置公历节假日Object{'0101':'元旦'}{}

Date options

参数说明类型默认值
disabled设置禁用状态,参数为当前日期,要求返回 BooleanFunction(Date)-
customDateStyle设置日期的自定义 className,参数为当前日期,要求返回 StringFunction(Date)-

datePicker Methods

方法名说明参数
nextMonth下一个月-
prevMonth上一个月-
toTargetDate去到指定的月份目标日期 (YYYY-MM-DD)String / Date
setCheckedDates设置要选中的日期选中的日期对象 { checkList, radioList }; checkList: 多选时范围选择的日期范围数组; radioList: 单选或多选时非范围选择的日期数组;
getAllSelectDate获取所有选中的日期-
clearDate参数为空或空数组时,请空所有选中日期;当参数为日期数组时,清除指定的数组中的日期Array'2022-09-08'

datePicker Events

事件名称说明回调参数
selected选中日期时触发选中的日期数组
cancel取消选中的日期时触发取消选中的日期数组

数据类型

interface dateOptionsType {
  lYear?: number;
  lMonth?: number;
  lDay?: number;
  Animal?: string;
  IMonthCn?: string;
  IDayCn?: string;
  cYear?: number;
  cMonth?: number;
  cDay?: number;
  gzYear?: string;
  gzMonth?: string;
  gzDay?: string;
  isToday?: boolean;
  isLeap?: boolean;
  nWeek?: number;
  ncWeek?: string;
  weekOfYear?: string;
  isTerm?: boolean;
  Term?: string | null;
  astro?: string;
  vacation?: string | null;
  disabled?: boolean;
  customDateStyle?: string;
  isSelected?: boolean;
  checkDateStartStyle?: boolean;
  checkDateStartEndStyle?: boolean;
  readonly?: boolean;
  leftTip?: string;
  rightTip?: string;
  customText?: string;
  formatDay: string;
  day: string;
  month: string;
  year: string;
}
  1. 初始化选中值 - 变化时,不能实时更新
  2. 手动选中功能有问题
  3. 设置默认选中的日期 - 结构复杂
1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago