1.0.0 • Published 5 years ago
vuetify-floating-message v1.0.0
Vuetify Floating Message
Installation
Install the package through npm
npm install vuetify-floating-messageAfter the package installation is done inside plugins/vuetify.js add the following code.
Vue.use(VuetifyFloatingMessage, { vuetify }); // Where vuetify is an instance of imported Vuetify vuetify.js fileNote: Do NOT forget to add the vuetify-floating-message inside vue.config.js under transpileDependencies.
Usage
Now from every vue component in your app, you can show a floating message with the following codes.
this.$message.info("a message"); //shows an info message
this.$message.warning("a message"); //shows a warning
this.$message.success("a message"); //shows a success
this.$message.error("a message"); //shows an errorHint: To all the above methods, there is a second parameter that you can pass which will give you the ability to do more customizations. options are described in below section.
Options
- dismissable: This option will ignore the timeout and will show a close icon instead.
- icon: By default
$messageis showing an icon based on the type of the message but you can give it a custom icon to show. - position: This option will let you to place the floating message at
toporbottomof the page.default: top - showIcon: This option will hide the icon inside the message, whether you have provided a custom icon or not.
default: false - theme: Set the theme of the message. If the theme is dark, the color for the type will be applied on the
backgroundof the message. If it is light then the background is white and only the icon colorif visibleis colored. - timeout: Set the
millisecondsthat it takes to hide the message.