Toast
Toast allows to show toast messages with the page or after an action is performed.
#Variants
You can use the various Variants of toast by passing a variation classes. LightVue comes with some stunning designs for Toast.There are different types of Toast are present in lightVue you can go through this page for more info. LightVue Toast is Both compatible with Vue 2.x and Vue 3.x.You have to render the toast component in your root file (App.vue).
#Positions
You can change the positions of notification in the following way.
#Options
You can use the sticky and multiple if.do not pass any value in duration in order to make it sticky.
#Remove All
For removing all the notifications on the screen you can use the removeAllGroups() method.
#Setup
You can import a component and register it as a local and global vue component as follows:
// import the component
import LvToast from 'lightvue/Toast';
// Register the component locally
export default {
components: {
LvToast
}
}
// Register the component globally (Vue 2.x)
Vue.component('LvToast', LvToast);
// Register the component globally (Vue 3.x)
const app = Vue.createApp({
// ...
});
app.component('LvToast', LvToast);
app.mount('#app')
#APIs
All of the props, events and slots of the component are mentioned below: