Skip to content

日历


image

介绍

日历组件用于选择日期。

API

Props

参数名描述类型默认值
status默认状态'default'|'hide'|'default'
value默认值string-
defaultMode默认模式'month'|'year''month'
customTdRender自定义单元格内容booleanfalse
renderTdFunc自定义单元格内容渲染函数Function'function render(ctx, params) {\n // 返回jsx渲染内容\n return {params.date}\n}'
customHeaderRender自定义头部内容booleanfalse
renderHeaderFunc自定义头部内容渲染函数Function'function render(ctx, params) {\n // 返回jsx渲染内容\n return {${params.year?.value} 年 ${params.month?.value} 月}\n}'
baseStyle自定义样式 , 表格整体自定义样式string-
customClass类名绑定 , 绑定类的名称string-
uniqueKey唯一标识 , 组件的唯一标识string-
authControl权限控制booleanfalse
loop循环 , 循环渲染设置Loop-

Events

事件名描述参数
onChange选择的日期改变时ctx
params: { value: string }
loop:LoopParams
onPanelChange日期面板改变时ctx
params: { value: string }
loop:LoopParams

Type

js
// 循环
type Loop = {
  "data": any[],
  "paramName": string,
  "indexName": string,
  "key": string
}


// 循环变量数据参数
type LoopParams = {
  "indexName":string,
  "paramName":string,
  "ref":ComputedRefImpl, // 全部的循环变量数据
  "row":number,
  "rowIndex":number
}[]