mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-03 11:47:48 +08:00
fix(components): [notification] custom icon not work (#9498)
This commit is contained in:
parent
fc7343be83
commit
ba15302200
@ -39,7 +39,7 @@ describe('Notification.vue', () => {
|
||||
|
||||
expect(wrapper.text()).toEqual(AXIOM)
|
||||
expect(vm.visible).toBe(true)
|
||||
expect(vm.iconComponent).toBe('')
|
||||
expect(vm.iconComponent).toBeUndefined()
|
||||
expect(vm.horizontalClass).toBe('right')
|
||||
expect(vm.positionStyle).toEqual({
|
||||
top: '0px',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { buildProps, definePropType } from '@element-plus/utils'
|
||||
import { buildProps, definePropType, iconPropType } from '@element-plus/utils'
|
||||
|
||||
import type { ExtractPropTypes, VNode } from 'vue'
|
||||
import type Notification from './notification.vue'
|
||||
@ -24,8 +24,7 @@ export const notificationProps = buildProps({
|
||||
default: 4500,
|
||||
},
|
||||
icon: {
|
||||
type: definePropType<string | Comment>([String, Object]),
|
||||
default: '',
|
||||
type: iconPropType,
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
|
@ -67,7 +67,7 @@ const typeClass = computed(() => {
|
||||
})
|
||||
|
||||
const iconComponent = computed(() => {
|
||||
if (!props.type) return ''
|
||||
if (!props.type) return props.icon
|
||||
return TypeComponentsMap[props.type] || props.icon
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user