Skip to content

Commit

Permalink
Merge pull request #8583 from element-plus/dev
Browse files Browse the repository at this point in the history
D2M
  • Loading branch information
iamkun committed Jul 1, 2022
2 parents b2823ba + d746c46 commit c5c7f07
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.en-US.md
@@ -1,4 +1,13 @@
## Changelog

### 2.2.8

_2022-07-01_

#### Bug fixes

- Components [radio] fix typo (#8556 by @holazz)
- Components [message] fix z-index & offset (#8582 by @sxzz)

### 2.2.7

Expand Down
8 changes: 4 additions & 4 deletions packages/components/message/src/instance.ts
@@ -1,13 +1,13 @@
import { shallowReactive } from 'vue'
import type { VNode } from 'vue'
import type { ComponentInternalInstance, VNode } from 'vue'
import type { Mutable } from '@element-plus/utils'
import type { MessageHandler, MessageInstance, MessageProps } from './message'
import type { MessageHandler, MessageProps } from './message'

export type MessageContext = {
id: string
vnode: VNode
handler: MessageHandler
vm: MessageInstance
vm: ComponentInternalInstance
props: Mutable<MessageProps>
}

Expand All @@ -26,5 +26,5 @@ export const getInstance = (id: string) => {
export const getLastOffset = (id: string): number => {
const { prev } = getInstance(id)
if (!prev) return 0
return prev.vm.bottom
return prev.vm.exposeProxy!.bottom
}
10 changes: 4 additions & 6 deletions packages/components/message/src/method.ts
Expand Up @@ -20,7 +20,6 @@ import type {
Message,
MessageFn,
MessageHandler,
MessageInstance,
MessageOptions,
MessageParams,
MessageParamsNormalized,
Expand Down Expand Up @@ -82,7 +81,7 @@ const createMessage = (

const props = {
...options,
zIndex: options.zIndex ?? nextZIndex(),
zIndex: nextZIndex() + options.zIndex,
id,
onClose: () => {
userOnClose?.()
Expand Down Expand Up @@ -110,14 +109,13 @@ const createMessage = (
// instances will remove this item when close function gets called. So we do not need to worry about it.
appendTo.appendChild(container.firstElementChild!)

const vm = vnode.component!.proxy as MessageInstance
const vm = vnode.component!

const handler: MessageHandler = {
// instead of calling the onClose function directly, setting this value so that we can have the full lifecycle
// for out component, so that all closing steps will not be skipped.
close: () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore `visible` from defineExpose
vm.visible = false
vm.exposeProxy!.visible = false
},
}

Expand Down
4 changes: 2 additions & 2 deletions packages/components/radio/src/radio.vue
Expand Up @@ -10,7 +10,7 @@
rawAttrs.class,
]"
:style="containerStyle"
v-bind="labelListieners"
v-bind="labelListeners"
>
<span
:class="[
Expand Down Expand Up @@ -61,7 +61,7 @@ const containerStyle = computed<StyleValue>(() => rawAttrs.style as StyleValue)
const inputAttrs = useAttrs({ excludeListeners: true })
const labelListieners = useAttrs({
const labelListeners = useAttrs({
excludeKeys: computed<string[]>(() => {
return Object.keys(inputAttrs.value)
}),
Expand Down

0 comments on commit c5c7f07

Please sign in to comment.