diff --git a/docs/components/dentry/calendar.md b/docs/components/dentry/calendar.md index f82d0171..c29a3348 100644 --- a/docs/components/dentry/calendar.md +++ b/docs/components/dentry/calendar.md @@ -813,6 +813,8 @@ export default { | choose | 选择之后或是点击确认按钮触发,日期数组(包含年月日和星期) | `(string \| string[])[]` | | close | 关闭时触发 | - | | select | 点击/选择后触发 | `(string \| string[])[]` | +| click-close-icon | 点击关闭图标后触发 | - | +| click-overlay | 点击遮罩关闭后触发 | - | ### Slots diff --git a/packages/nutui/components/calendar/calendar.ts b/packages/nutui/components/calendar/calendar.ts index f5c0a486..ac6695df 100644 --- a/packages/nutui/components/calendar/calendar.ts +++ b/packages/nutui/components/calendar/calendar.ts @@ -110,6 +110,8 @@ export const calendarEmits = { [CLOSE_EVENT]: () => true, [UPDATE_VISIBLE_EVENT]: (val: boolean) => isBoolean(val), [SELECT_EVENT]: (val: any) => val, + clickCloseIcon: () => true, + clickOverlay: () => true, } export type CalendarEmits = typeof calendarEmits diff --git a/packages/nutui/components/calendar/calendar.vue b/packages/nutui/components/calendar/calendar.vue index 923dd102..8dfbb128 100644 --- a/packages/nutui/components/calendar/calendar.vue +++ b/packages/nutui/components/calendar/calendar.vue @@ -77,6 +77,14 @@ function select(param: string) { // close(); emit(SELECT_EVENT, param) } + +function onClickCloseIcon() { + emit('clickCloseIcon') +} + +function onClickOverlay() { + emit('clickOverlay') +}