mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-11-30 18:27:40 +08:00
fix(components): fix message closeAll (#3583)
This commit is contained in:
parent
d8954f945e
commit
34745432d1
@ -5,7 +5,12 @@ import isServer from '@element-plus/utils/isServer'
|
|||||||
import MessageConstructor from './message.vue'
|
import MessageConstructor from './message.vue'
|
||||||
import { messageTypes } from './message'
|
import { messageTypes } from './message'
|
||||||
|
|
||||||
import type { MessagePartial, MessageQueue, MessageProps } from './message'
|
import type {
|
||||||
|
MessagePartial,
|
||||||
|
Message,
|
||||||
|
MessageQueue,
|
||||||
|
MessageProps,
|
||||||
|
} from './message'
|
||||||
import type { ComponentPublicInstance, VNode } from 'vue'
|
import type { ComponentPublicInstance, VNode } from 'vue'
|
||||||
|
|
||||||
const instances: MessageQueue = []
|
const instances: MessageQueue = []
|
||||||
@ -110,11 +115,11 @@ export function close(id: string, userOnClose?: (vm: VNode) => void): void {
|
|||||||
|
|
||||||
export function closeAll(): void {
|
export function closeAll(): void {
|
||||||
for (let i = instances.length - 1; i >= 0; i--) {
|
for (let i = instances.length - 1; i >= 0; i--) {
|
||||||
const instance = instances[i].vm.component as any
|
const instance = instances[i].vm.component
|
||||||
instance.ctx.close()
|
;(instance?.proxy as any)?.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message.closeAll = closeAll
|
message.closeAll = closeAll
|
||||||
|
|
||||||
export default message
|
export default message as Message
|
||||||
|
Loading…
Reference in New Issue
Block a user