1.1.6 • Published 2 years ago

wm-date-picker-ui-ts v1.1.6

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

Vue3插件

需要vue3版本

Install

npm i wm-date-picker-ui-ts -S

Quick Start

import { createApp } from 'vue'

import 'wm-date-picker-ui-ts/datePicker-ui.css'
import datePicker from 'wm-date-picker-ui-ts'

const app = createApp(App)

app.use(datePicker).mount('#app')

API

参数说明类型默认值
initMonth初始化日期String/Date当天
calendarMode周起始日'Sunday':周日, 'Monday':周一Monday
pickerOptions日历多选数据项配置Object-
readOnly只读Booleanfalse
isShowTitle是否展示日历标题Booleantrue
selectMode选择模式'single':单选, 'multiple':多选 , 'series':范围选择single
leftCornerText日期左上角文字提示String''
rightCornerText日期右上角文字提示String''
startCornerText范围选择时,开始位置-日期底部提示(selectMode为'series'时,有效)String开始
endCornerText范围选择时,结束位置-日期底部提示(selectMode为'series'时,有效)String结束
startEndCornerText范围选择时,开始和结束位置相同-日期底部提示(selectMode为'series'时,有效)String始/终
lunarHolidays设置农历节假日Object{'0101':'春节'}{}
gregorianHolidays设置公历节假日Object{'0101':'元旦'}{}
defaultSingleCheckedDates设置默认选中日期Date[] , string[] , number[] , SetDateObjectType[] , string , Date , number , SetDateObjectType''
defaultSeriesCheckedDates设置默认范围选中日期SetDateObjectType[] , SetDateObjectType[]

Date options

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

datePicker Methods

方法名说明参数
nextMonth下一个月-
prevMonth上一个月-
toTargetDate去到指定的月份目标日期 (YYYY-MM-DD)String / Date / number
setCheckedDates设置要选中的日期dates:Date[] , YYYY-MM-DD[] , number[] , SetDateObjectType[] , ‘YYYY-MM-DD’ , Date , number , SetDateObjectType
getAllSelectedDate获取所有选中的日期-
clearSelectedDate参数为空时,请空所有选中日期;当参数为日期或日期数组时,清除指定的日期或数组中的日期dates ?: Date , ‘YYYY-MM-DD’ , number , Date[] , YYYY-MM-DD[] , number[]

datePicker Events

事件名称说明回调参数
singleSelect选中单个日期时触发参数1: 当前选中的日期, 参数2: 已选中的所有单选日期数组
seriesSelect选中日期范围时触发参数1: 当前选中的日期, 参数2: 已选中的所有范围选中日期数组
singleDelete取消选中的单个日期时触发当前删除的日期
seriesDelete取消选中的日期范围时触发参数1:当前点击删除的日期, 参数2: 删除的范围日期数据数组

数据类型

interface SetDateObjectType {
  day: string, 
  leftCornerText?: string,
  rightCornerText?: string
}

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;
  isCurrentMonth?: boolean;
  isSingleClick?: boolean;
  leftCornerText?: string;
  rightCornerText?: string;
  bottomCornerText?: string;
  isStartDate?: boolean;
  isSeriesMiddle?: boolean;
  cellClassName?: string;
}

Construct待补充

1. 需要添加一个 change 事件
1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.8

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