解决
import { ElNotification } from 'element-plus';
import Icon from '@/components/notifyIcon.vue';
export const notify = (message, title = '消息通知') => {
ElNotification({
title,
message,
duration: 0,
type: 'none',
icon: Icon,
});
};
官方文档

原因
V2.2.14 源码
<el-icon v-if="iconComponent" :class="[ns.e('icon'), typeClass]">
<component :is="iconComponent" />
</el-icon>
const iconComponent = computed(() => {
if (!props.type) return ''
return TypeComponentsMap[props.type] || props.icon
})
V2.3.0源码
<el-icon v-if="iconComponent" :class="[ns.e('icon'), typeClass]">
<component :is="iconComponent" />
</el-icon>
const iconComponent = computed(() => {
if (!props.type) return props.icon
return TypeComponentsMap[props.type] || props.icon
})