1.0.7 • Published 2 years ago

@kuy472013/vue-notification v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm version npm

Vue.js Notification

Setup

package install

npm install --save @kuy472013/vue-notification

main.js

import { createApp } from 'vue'
import App from './App.vue'
import Notifications from '@kuy472013/vue-notification'

const app = createApp(App)
app.use(Notifications)

App.vue

<Notification />

Usage

You can show notifications by calling the registered view plugin.

<template>
  <div id='app'>
    <button @click='test()'>test</button>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods: {
    test: function () {
      this.$notification()
    }
  }
}
</script>

Props

Common notification settings can be changed using props.

<Notification
  position='left-bottom'
  :duration=5000
/>
NameTypeDefaultDescription
widthNumber250Option to set the width of the notification element.(must be a numeric, unit: px)
heightNumber50Option to set the heigth of the notification element.(must be a numeric, unit: px)
positionStringcenter-bottomOption to specify where the notification element will be shown.Please enter a combination of the values below.X: 'left', 'right', 'center'Y: 'top', 'bottom'
speedNumber1000Option to set the animation duration of the notification element.(unit: ms)
durationNumber3000Option to set how long the notification element stays on the screen.(unit: ms)

API

API provided by notification plugin.

app.$notification({
  type: 'success',
  classes: 'customStyle',
  contents: message,
})
NameTypeDefaultDescription
typeStringinfoYou can use the notification plugin to set among the types of notifications provided by default.supported types : success, error, warning, info
classesStringnullYou can set up a separate class using the notification plugin to specify custom styles.
contentsStringmessageYou can configure the content of the notification using the notification plugin.
componentVue ComponentnullBy using the notification plugin, you can use a component created separately from the design provided by default.
1.0.7

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago