nuxt3-notifications
v1.3.1
Published
<p> <a href="https://www.npmjs.com/package/nuxt3-notifications" target="_blank"><img src="https://img.shields.io/npm/v/nuxt3-notifications" alt="Version"></a> <a href="https://www.npmjs.com/package/nuxt3-notifications" target="_blank"><img src="https:
Downloads
14,179
Maintainers
Readme
Nuxt3 Notifications Module
This is module @kyvg/vue3-notification for Nuxt3
📦 Get Started
- Install
nuxt3-notificationsas project dependency:
npm install --save-dev nuxt3-notifications # npm
yarn add -D nuxt3-notifications # yarn classic
pnpm i -D nuxt3-notifications # pnpm- Add it to the
modulessection of yournuxt.config:
export default defineNuxtConfig({
modules: ['nuxt3-notifications'],
});🚀 Example
<!-- app.vue -->
<template>
<NuxtNotifications position="bottom left" :speed="500" />
</template><!-- page.vue/component.vue -->
<script setup>
const { notify } = useNotification();
function onClick() {
notify({
title: "Title",
text: "Hello notify!",
});
}
</script>
<template>
<button @click="onClick">Show notify</button>
</template>🔨 Config
export default defineNuxtConfig({
modules: ['nuxt3-notifications'],
nuxtNotifications: {
componentName: 'Foo' // 'foo-bar' or 'FooBar' for components of two or more words
},
});💻 Development
- Fork and clone windx-foobar/nuxt3-notifications
- Enable corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
- Install dependencies using
pnpm install - Run
pnpm dev:prepareto generate type stubs. - Use
pnpm devto start playground in development mode.
