Repository: element-plus/element-plus
File: packages/components/message/src/message.vue (Vue)

Code before:
  TypeComponents,
  TypeComponentsMap,
  getEventCode,
} from '@element-plus/utils'
import { EVENT_CODE } from '@element-plus/constants'
import ElBadge from '@element-plus/components/badge'
import { useGlobalComponentSettings } from '@element-plus/components/config-provider'
import { ElIcon } from '@element-plus/components/icon'
import {
  MESSAGE_DEFAULT_PLACEMENT,
  messageDefaults,
  messageEmits,
} from './message'
import { getLastOffset, getOffsetOrSpace } from './instance'

import type { BadgeProps } from '@element-plus/components/badge'
import type { CSSProperties } from 'vue'
import type { MessageProps } from './message'

const { Close } = TypeComponents

defineOptions({
  name: 'ElMessage',
})

const props = withDefaults(defineProps<MessageProps>(), messageDefaults)
const emit = defineEmits(messageEmits)

const isStartTransition = ref(false)

const { ns, zIndex } = useGlobalComponentSettings('message')
const { currentZIndex, nextZIndex } = zIndex

const messageRef = ref<HTMLDivElement>()
const visible = ref(false)
const height = ref(0)

let stopTimer: (() => void) | undefined = undefined

const badgeType = computed<BadgeProps['type']>(() =>
  props.type ? (props.type === 'error' ? 'danger' : props.type) : 'info'
)
const typeClass = computed(() => {
  const type = props.type
  return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }
})
const iconComponent = computed(
  () => props.icon || TypeComponentsMap[props.type] || ''
)

const placement = computed(() => props.placement || MESSAGE_DEFAULT_PLACEMENT)

Review comment (suggestion):
<img width="553" height="35" alt="Image" src="https://github.com/user-attachments/assets/8e192089-dda8-4c04-8b5c-e4144e9594e3" />

We should exclude `appendTo`.
`omit(messageDefaults, 'appendTo')`

Code after:
  TypeComponents,
  TypeComponentsMap,
  getEventCode,
} from '@element-plus/utils'
import { EVENT_CODE } from '@element-plus/constants'
import ElBadge from '@element-plus/components/badge'
import { useGlobalComponentSettings } from '@element-plus/components/config-provider'
import { ElIcon } from '@element-plus/components/icon'
import {
  MESSAGE_DEFAULT_PLACEMENT,
  messageDefaults,
  messageEmits,
} from './message'
import { getLastOffset, getOffsetOrSpace } from './instance'
import { omit } from 'lodash-unified'

import type { BadgeProps } from '@element-plus/components/badge'
import type { CSSProperties } from 'vue'
import type { MessageProps } from './message'

const { Close } = TypeComponents

defineOptions({
  name: 'ElMessage',
})

const props = withDefaults(
  defineProps<MessageProps>(),
  omit(messageDefaults, 'appendTo')
)
const emit = defineEmits(messageEmits)

const isStartTransition = ref(false)

const { ns, zIndex } = useGlobalComponentSettings('message')
const { currentZIndex, nextZIndex } = zIndex

const messageRef = ref<HTMLDivElement>()
const visible = ref(false)
const height = ref(0)

let stopTimer: (() => void) | undefined = undefined

const badgeType = computed<BadgeProps['type']>(() =>
  props.type ? (props.type === 'error' ? 'danger' : props.type) : 'info'
)
const typeClass = computed(() => {
  const type = props.type
  return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }
})
const iconComponent = computed(