Skip to content

Commit

Permalink
feat: vnode support added to toast message
Browse files Browse the repository at this point in the history
  • Loading branch information
antlionguard committed Jun 11, 2024
1 parent 61929ea commit 848c6c5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/primevue/src/toast/ToastMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<component :is="templates.messageicon ? templates.messageicon : templates.icon ? templates.icon : iconComponent && iconComponent.name ? iconComponent : 'span'" :class="cx('messageIcon')" v-bind="ptm('messageIcon')" />
<div :class="cx('messageText')" v-bind="ptm('messageText')">
<span :class="cx('summary')" v-bind="ptm('summary')">{{ message.summary }}</span>
<div :class="cx('detail')" v-bind="ptm('detail')">{{ message.detail }}</div>
<template v-if="!isVNode(message.detail)">
{{ message.detail }}
</template>
<component v-else :is="message.detail" />
</div>
</template>
<component v-else :is="templates.message" :message="message"></component>
Expand All @@ -27,6 +30,7 @@ import InfoCircleIcon from '@primevue/icons/infocircle';
import TimesIcon from '@primevue/icons/times';
import TimesCircleIcon from '@primevue/icons/timescircle';
import Ripple from 'primevue/ripple';
import { isVNode } from 'vue';
export default {
name: 'ToastMessage',
Expand Down Expand Up @@ -91,7 +95,8 @@ export default {
clearTimeout(this.closeTimeout);
this.closeTimeout = null;
}
}
},
isVNode
},
computed: {
iconComponent() {
Expand Down

0 comments on commit 848c6c5

Please sign in to comment.