Comparing version 1.1.5 to 1.1.6
{ | ||
"license": "MIT", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"author": "ctf0", | ||
@@ -13,2 +13,5 @@ "name": "vue-notif", | ||
}, | ||
"peerDependecies": { | ||
"vue": "^2.0.0" | ||
}, | ||
"dependencies": { | ||
@@ -15,0 +18,0 @@ "vuemit": "^1.0.0" |
@@ -13,55 +13,53 @@ # Vue Notif | ||
**1-** register the component | ||
- register the component "we use ***Bulma*** for styling the notification cards". | ||
- we use ***Bulma*** for styling the notification cards. | ||
```js | ||
window.Vue = require('vue') | ||
window.EventHub = require('vuemit') | ||
```js | ||
window.Vue = require('vue') | ||
window.EventHub = require('vuemit') | ||
Vue.component('MyNotification', require('vue-notif')) | ||
``` | ||
Vue.component('MyNotification', require('vue-notif')) | ||
``` | ||
- now call it either | ||
**2-** now call it either | ||
+ from html | ||
- from html | ||
```html | ||
// for example when the backend is redirecting back with a msg | ||
<div class="notif-container"> | ||
@if (session('status')) | ||
<my-notification | ||
icon="false" | ||
title="title" | ||
body="body" | ||
type="success/error/primary/warning" | ||
duration="1/2/etc.."> | ||
</my-notification> | ||
@endif | ||
</div> | ||
``` | ||
```html | ||
// for example when the backend is redirecting back with a msg | ||
<div class="notif-container"> | ||
@if (session('status')) | ||
<my-notification | ||
icon="false" | ||
title="title" | ||
body="body" | ||
type="success/error/primary/warning" | ||
duration="1/2/etc.."> | ||
</my-notification> | ||
@endif | ||
</div> | ||
``` | ||
+ or from js | ||
- or from js | ||
```js | ||
EventHub.fire('showNotif',{ | ||
title: 'title', | ||
body: 'body', | ||
type: 'success', | ||
duration: 1, | ||
icon: false, | ||
onClose(){ | ||
// what happen when notification is closed | ||
} | ||
}); | ||
``` | ||
```js | ||
EventHub.fire('showNotif',{ | ||
title: 'title', | ||
body: 'body', | ||
type: 'success', | ||
duration: 1, | ||
icon: false, | ||
onClose(){ | ||
// what happen when notification is closed | ||
} | ||
}); | ||
``` | ||
```html | ||
<div class="notif-container"> | ||
<my-notification></my-notification> | ||
</div> | ||
``` | ||
```html | ||
<div class="notif-container"> | ||
<my-notification></my-notification> | ||
</div> | ||
``` | ||
> - type > `default: info` | ||
> - duration > `default: null` if not present, card will remain visible | ||
> - icon > `default: true` | ||
> - type : `default: info` | ||
> - duration : `default: null` if not present, card will remain visible | ||
> - icon : `default: true` |
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
10
1
12204
64