1.0.11 โ€ข Published 1 month ago

aak-nuxt3-notifications v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Nuxt3 Notifications Module

This is module aak-nuxt3-notifications for Nuxt3

๐Ÿ“ฆ Get Started

  1. Install aak-nuxt3-notifications as project dependency:
npm i aak-nuxt3-notifications # npm

yarn add aak-nuxt3-notifications # yarn
  1. Add it to the modules section of your nuxt.config:
export default defineNuxtConfig({
  modules: [
    'aak-nuxt3-notifications',
  ],
})

๐Ÿš€ Example

Example

<!-- component.vue -->

<script setup>
  const { $notify } = useNuxtApp()

  const acceptsAnObject = () => $notify.info({ 
                                    title: 'Title message', 
                                    message: 'Text message', 
                                    position: 'bottom-right',
                                    duration: 8000
                                  })
  // โ€Žโ€งโ‚Šหšโœง[Only text]โœงหšโ‚Šโ€ง
  const onlyText = () => $notify.info('You can only specify the text') 

  const info = () => $notify.info('An info-style message') // ๐Ÿ’ฌ
  const success = () => $notify.success('An success-style message') // โœ…
  const warning = () => $notify.warning('An warning-style message') // โš ๏ธ
  const error = () => $notify.error('An error-style message') // โ—
</script>

<template>
  <button @click="acceptsAnObject">Show notify acceptsAnObject</button>
  <button @click="onlyText">Show notify onlyText</button>
  <button @click="info">Show notify info</button>
  <button @click="success">Show notify success</button>
  <button @click="warning">Show notify warning</button>
  <button @click="error">Show notify error</button>
</template>

Example

๐Ÿ”จ API

Options

NameDescriptionTypeDefault
titletitlestring''
messagedescription textstring''
offsetoffset from the top edge of the screen. Every Notification instance of the same moment should have the same offsetnumber0
positioncustom position'top-right' 'top-left' 'bottom-right' 'bottom-left'"top-right
durationduration before close. It will not automatically close if set 0number undefinedduration is calculated based on the number of characters in a string, but not less than 4000, and if duration === undefined, then duration 4000
typenotification type'success' 'warning' 'info' 'error' ''''

๐Ÿ’ป Development

1.0.11

1 month ago

1.0.10

1 month ago

1.0.9

1 month ago

1.0.8

1 month ago

1.0.7

1 month ago

1.0.6

1 month ago

1.0.5

1 month ago

1.0.4

1 month ago

1.0.3

1 month ago

0.0.2

1 month ago