hae
Version:
Mobile web UI based on Vux
261 lines (260 loc) • 9.44 kB
YAML
category:
en: Form
'zh-CN': 表单
icon: ''
tags:
en:
- form
- calendar
zh-CN:
- 日历
- 表单
props:
value:
type: String, Array
default: ''
en: calendar value, use `v-modle` for binding. String (including empty) means single seleciton; array (including empty array) means multiple selection.
zh-CN: 当前选中日期,使用`v-model`绑定。值为字符串(包括空字符串)时表示单选日期,为数组(包括空数组)时表示多选。
render-month:
type: Array
default: ''
en: specify which date to render, for example [2018, 8]
zh-CN: 指定渲染日期,如 [2018, 8]
start-date:
type: String
default: ''
en: 'start date with format `YYYY-MM-dd`'
zh-CN: '起始日期,格式为 `YYYY-MM-dd`'
end-date:
type: String
default: ''
en: 'end date with format `YYYY-MM-dd`'
zh-CN: '结束日期,格式为`YYYY-MM-dd`'
show-last-month:
type: Boolean
default: true
en: if show last month's days
zh-CN: 是否显示上个月的日期
show-next-month:
type: Boolean
default: true
en: if show next month's days
zh-CN: 是否显示下个月的日期
highlight-weekend:
type: Boolean
default: false
en: if highlight weekend days
zh-CN: 是否高亮周末
return-six-rows:
type: Boolean
default: true
en: if always show six rows
zh-CN: 是否总是渲染6行日期
hide-header:
type: Boolean
default: false
en: if hiding header
zh-CN: 是否隐藏日历头部
hide-week-list:
type: Boolean
default: false
en: if hiding week list
zh-CN: 是否隐藏星期列表
replace-text-list:
type: 'Object'
default: ''
en: replace list, for example, {'TODAY':'今'}
zh-CN: "替换列表,可以将默认的日期换成文字,比如今天的日期替换成今,{'TODAY':'今'}"
weeks-list:
type: Array
default: "['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']"
en: 'week list, starting from `Sunday`'
zh-CN: 星期列表,从周日开始
render-function:
type: Function
default: ''
en: render function to add extra contents, params `(line, row, dateData)`
zh-CN: 用于为特定日期添加额外的html内容,参数为(行index,列index,日期详细属性)
render-on-value-change:
type: Boolean
default: true
en: if re-render calendar if value changes, should set to false when showing multi months
zh-CN: 当日期变化时是否重新渲染日历,如果是渲染了多个日历的话需要设为false
disable-past:
type: Boolean
default: false
en: if disable the past days, can work with start-date
zh-CN: 禁止选择过去的日期,该选项可以与 start-date 同时使用
disable-future:
type: Boolean
default: false
en: if disable future days, can work with end-date
zh-CN: 禁止选择未来的日期,该选项可以 end-date 同时使用
marks:
version: v2.6.0
type: Array
en: (beta) style marks for specified date list
zh-CN: (beta) 自定义日期标记
disable-weekend:
version: v2.7.0
type: Boolean
default: false
en: whether disable weekends
zh-CN: 是否禁用周六日
disable-date-function:
version: v2.7.0
type: Function
params: '`(date)`'
en: check if a date should be disabled
zh-CN: 自定义标记特定日期是否应该禁用,返回 true 表示禁用,false 表示不禁用,不返回表示和原有逻辑一致(这样不影响和 disable-weekend 等禁用属性同时使用)
slots:
each-day:
version: v2.3.5
en: you can custom how to display each day
zh-CN: 用以自定义每一天的显示渲染,推荐使用该 slot 来替代 render-function
events:
on-change:
en: emits when value is changed
zh-CN: 值变化时触发
on-view-change:
version: v2.5.12
params: '(data, index)'
en: fires when render month is changed
zh-CN: 渲染月份变化时触发。初始化时会触发一次,如果不希望处理初始化时的触发,可以检查第二个参数是否为 0
on-select-single-date:
version: 2.7.6
params: '(currentValue)'
en: fires when date is selected in radio mode
zh-CN: 单选模式下选中日期时触发
methods:
getDates:
version: v2.5.11
en: get current date list
zh-CN: 获取当前日期列表
switchViewToToday:
version: v2.5.12
en: render current month
zh-CN: 渲染当天所在月份
switchViewToMonth:
version: v2.5.12
params: (year, month)
en: render specified year and month
zh-CN: 渲染特定年月日期
switchViewToCurrentValue:
version: v2.5.12
en: render with current value's month
zh-CN: 渲染当前值所在月份
changes:
v2.7.6:
en:
- '[feature] add event:on-select-single-date'
zh-CN:
- '[feature] 添加事件 on-select-single-date'
v2.7.3:
en:
- '[fix] disable-date-function result conflicts with disable-weekend #2189'
zh-CN:
- '[fix] 修复 disable-date-function 取值与禁用周末逻辑冲突 #2189'
v2.7.2:
en:
- '[fix] fix reset-value issue in multiple mode #2160'
- '[fix] fix props missing in calendar #2105'
- '[fix] fix disabled weekends still selectable #2178'
zh-CN:
- '[fix] 修复多选情况下重置值时没有正确渲染的问题 #2160'
- '[fix] 修复部分属性没有继承 inline-calendar 的问题 #2105'
- '[fix] 修复禁用周末日期仍能点击的问题 #2178'
v2.7.0:
en:
- '[enhance] call render function on created hook instead of mounted(ssr)'
- '[feature] add prop:disable-weekend #2105'
- '[feature] add prop:disable-date-function #2105'
- '[fix] remove useless re-render function #2066'
zh-CN:
- '[enhance] 在 created hook 执行渲染而不是 mounted(ssr)'
- '[feature] 添加属性 prop:disable-weekend 来禁用周末 #2105'
- '[feature] 添加属性 prop:disable-date-function 自定义标记禁用日期 #2105'
- '[fix] 移除重复的多次重复渲染 #2066'
v2.6.0:
en:
- '[feature] (beta) Support prop:marks to style specified date item'
- '[fix] fix i18n for days'
zh-CN:
- '[feature] (beta) 支持属性 marks 用以自定义特定日期显示样式'
- '[fix] 修复星期文字 i18n'
v2.5.12:
en:
- '[feature] add method:switchViewToToday switchViewToMonth'
- '[feature] support event:on-view-change'
zh-CN:
- '[feature] 支持 switchViewToToday, switchViewToMonth 等手动渲染方法'
- '[feature] 支持事件 on-view-change,方便切换月份时请求数据'
v2.5.11:
en:
- '[feature] support method:getDates'
- '[feature] support less variable @calendar-bg-color'
zh-CN:
- '[feature] 支持方法 getDates 用于需要获取渲染日期列表的场合'
- '[feature] 支持 less 变量 @calendar-bg-color'
v2.5.9:
en:
- '[fix] donot set value to empty string when clicking on current selected item #1862'
zh-CN:
- '[fix] 点击当前日期项时不把值置为空 #1862'
v2.5.8:
en:
- '[fix] fix on-change event fires twice #1847'
zh-CN:
- '[fix] 修复 on-change 事件触发两次问题 #1847'
v2.5.5:
en:
- '[feature] support multi select #1446 #1467'
zh-CN:
- '[feature] 支持多选 #1446 #1467'
v2.4.0:
en:
- '[enhance] re-render when render-month is changed'
zh-CN:
- '[enhance] 当 render-month 变化时重新渲染日历'
v2.3.8:
en:
- '[enhance] prevent from clicking invisiable date #1564'
zh-CN:
- '[enhance] 不可见日期不可点击 #1564'
v2.3.6:
en:
- '[change] render-function params day => date #1361'
zh-CN:
- '[change] render-function 参数 day => date(在 3.0 版本前不会影响目前使用)#1361'
v2.3.5:
en:
- '[feature] Support slot:each-day'
zh-CN:
- '[feature] 支持自定义每一天的 html 渲染 slot:each-day'
v2.3.1:
en:
- '[fix] Fix render-function-generated-content visibility issue #1409'
zh-CN:
- '[fix] 修复 render-function 生成的内容错误显示问题 #1409'
v2.2.2:
en:
- "[enhance] when replace text of date is empty string, span of date will not show"
zh-CN:
- '[enhance] 当日期的替代文字为空字符串时,包含日期的 `span` 元素将不显示'
v2.2.1-rc.2:
en:
- "[enhance] Now next month's day can be clicked and will automatically switch to next month's view #1192"
- "[fix] fix start-date and end-date not reactive #1219"
zh-CN:
- '[enhance] 可以点击下个月日期并自动切换到下个月 #1192'
- '[fix] 修复 start-date 和 end-date 变化后不重新渲染的问题 #1219'
v2.1.1-rc.10:
en:
- '[feature] Add more less variables. #896'
zh-CN:
- '[feature] 支持多个 less 变量. #896'
v2.1.1-rc.5:
en:
- '[fix] fix render-function not reactive'
zh-CN:
- '[fix] 修复 render-function 变化不重新渲染的问题'