vue3-notification
v0.0.3
Published
Based on [vue-snotify](https://github.com/artemsky/vue-snotify) for Vue 2.
Downloads
86
Maintainers
Readme
Vue Snotify for Vue 3
Based on vue-snotify for Vue 2.
How to use
npm i --save vue3-notify
In main.ts :
import notify from 'vue3-notification';
const app = createApp(App)
app.use(notify);
app.mount('#app');
In App.vue:
<vue3-notify />
Vue Options API:
methods: {
handleClick() {
this.$snotify.success("Lorem ipsum dolor sit amet!");
}
}
Inject function for Vue files
The plugin automatically sets global provide() with key "vue3-notify".
<script setup>
import { inject } from "vue";
const snotify: (any) = inject("vue3-notify");
function handleClick() {
handleClick() {
snotify.success("Lorem ipsum dolor sit amet!");
}
};
</script>