diff --git a/packages/notify/Notify.tsx b/packages/notify/Notify.tsx index c6e883d16..05c94c798 100644 --- a/packages/notify/Notify.tsx +++ b/packages/notify/Notify.tsx @@ -1,6 +1,6 @@ import { use } from '../utils'; import { RED, WHITE } from '../utils/color'; -import { emit, inherit } from '../utils/functional'; +import { inherit } from '../utils/functional'; import { PopupMixin } from '../mixins/popup'; import Popup from '../popup'; @@ -38,16 +38,7 @@ function Notify( overlay={false} lockScroll={false} class={[bem(), props.className]} - onInput={(value: boolean) => { - emit(ctx, 'input', value); - }} - onClick={(event: Event) => { - emit(ctx, 'click', event); - }} - onOpened={() => { - emit(ctx, 'opened'); - }} - {...inherit(ctx)} + {...inherit(ctx, true)} > {props.message} diff --git a/packages/notify/index.ts b/packages/notify/index.ts index f30884e10..8a80ccc59 100644 --- a/packages/notify/index.ts +++ b/packages/notify/index.ts @@ -26,6 +26,11 @@ function Notify(options: NotifyOptions) { instance.onClick(event); } }, + close() { + if (instance.onClose) { + instance.onClose(); + } + }, opened() { if (instance.onOpened) { instance.onOpened(); @@ -67,10 +72,6 @@ function defaultOptions(): NotifyOptions { Notify.clear = () => { if (instance) { instance.value = false; - - if (instance.onClose) { - instance.onClose(); - } } };