Notifications

Basic usage:

Displays a global notification message. Voicenter UI has registered the $notify property with some methods and global VcNotification component . the notification automatically closes after 4500ms, but by setting duration you can control its duration. Specifically, if set to 0, it will not close automatically. Note that duration receives a Number in milliseconds. Default Position: top-right

With types:

We provide four types: success, warning, info and error.

Position:

Notification can emerge from any corner you like. Position default is 'top-right'. Other valid values are "top-left", "top-center", "bottom-left", "bottom-center", "bottom-right" and "center". Position is set by props on VcNotification component.

Use HTML or Template

Templating allows customizing the content where the message instance is available as the implicit variable. You can use render function or just use Global or local component with render function

Attributes for Component

AttributeDescriptionTypeAccepted ValuesDefault
positionPosition of the messages in viewport.String'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center'top-right
groupUnique identifier of a message groupString---null
autoZIndexWhether to automatically manage layeringBooleantrue | falsetrue
baseZIndexBase zIndex value to use in layeringNumber---3000

Attributes for Message

AttributeDescriptionTypeAccepted ValuesDefault
typeType of MessageString'success' | 'info' | 'warning' | 'error' | undefinedundefined
titleTitle content of the message.String---
messageDetail content of the message.String---
closableWhether the message can be closed manually using the close icon. True if value not 'false' or duration '0'Booleantrue | falsetrue
durationDelay in milliseconds to close the message automatically. (0 - infinity)Number---4500
groupKey of the Toast to display the message.String---
styleClassStyle class of the message.String---
contentStyleClassStyle class of the content.String---
positionchange position of groupString---
componentComponent for custom content of message. Use Name of Global component or render function (h())String | VNode | undefined---undefined
componentAttrsAttributes for component (will use v-bind for custom component)Object | Arrayundefined

Message Service API

MethodDescriptionParameters
addDisplays the message in a suitable Notification component.message: Message instance
removeGroupClears the messages that belongs to the group.group: Name of the message group
removeAllGroupClears all the messages.