Skip to content

Commit

Permalink
[feature] fix warning (#125)
Browse files Browse the repository at this point in the history
* Update Notifications.vue

* Update README.md

* Update Notifications.vue
  • Loading branch information
euvl authored Apr 21, 2019
1 parent c82d8ee commit 4ec221d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
[![npm version](https://badge.fury.io/js/vue-notification.svg)](https://badge.fury.io/js/vue-notification)
[![npm](https://img.shields.io/npm/dm/vue-notification.svg)](https://www.npmjs.com/package/vue-notification)

### Why this fork ?

I corrected a Vue warning due to the use of a Javascript keywork as a property name inside vue-notification.
```
avoid using JavaScript keyword as property name: "if"
Raw expression: @click="if (closeOnClick) destroy(item)"
```

### Vue.js notifications

Demo: http://vue-notification.yev.io/
Expand Down
7 changes: 6 additions & 1 deletion src/Notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- Default slot template -->
<div
:class="notifyClass(item)"
@click="if (closeOnClick) destroy(item)"
@click="destroyIfNecessary(item)"
>
<div
v-if="item.title"
Expand Down Expand Up @@ -197,6 +197,11 @@ const Component = {
},
},
methods: {
destroyIfNecessary(item){
if(this.closeOnClick){
this.destroy(item);
}
},
addItem (event) {
event.group = event.group || ''
Expand Down

0 comments on commit 4ec221d

Please sign in to comment.