1
1
/*!
2
- * vue-notifyjs v0.1.3
2
+ * vue-notifyjs v0.1.4
3
3
* (c) 2017-present cristij <joracristi@gmail.com>
4
4
* Released under the MIT License.
5
5
*/
@@ -31,6 +31,9 @@ var Notification = {
31
31
default : function _default ( ) {
32
32
return new Date ( ) ;
33
33
}
34
+ } ,
35
+ component : {
36
+ type : [ Object , Function ]
34
37
}
35
38
} ,
36
39
data : function data ( ) {
@@ -78,19 +81,21 @@ var Notification = {
78
81
setTimeout ( this . close , this . timeout ) ;
79
82
}
80
83
} ,
81
- render : function render ( ) {
82
- var h = arguments [ 0 ] ;
83
-
84
+ render : function render ( h ) {
85
+ var componentName = this . component ;
84
86
return h (
85
87
'div' ,
86
88
{
89
+ on : {
90
+ 'click' : this . close
91
+ } ,
87
92
attrs : {
88
93
'data-notify' : 'container' ,
89
94
90
95
role : 'alert' ,
91
96
92
97
'data-notify-position' : 'top-center' } ,
93
- 'class' : [ 'col-xs-11 col-sm-4 alert open ' , { 'alert-with-icon' : this . icon } , this . verticalAlign , this . horizontalAlign , this . alertType ] , style : this . customPosition } ,
98
+ 'class' : [ 'alert open ' , { 'alert-with-icon' : this . icon } , this . verticalAlign , this . horizontalAlign , this . alertType ] , style : this . customPosition } ,
94
99
[ h (
95
100
'button' ,
96
101
{
@@ -116,7 +121,11 @@ var Notification = {
116
121
{
117
122
attrs : { 'data-notify' : 'message' }
118
123
} ,
119
- [ this . message ]
124
+ [ this . message !== undefined && this . message , this . component !== undefined && h (
125
+ this . component ,
126
+ null ,
127
+ [ ]
128
+ ) ]
120
129
) ]
121
130
) ;
122
131
}
@@ -166,7 +175,8 @@ var Notifications = {
166
175
icon : notification . icon ,
167
176
message : notification . message ,
168
177
timeout : notification . timeout ,
169
- type : notification . type
178
+ type : notification . type ,
179
+ component : notification . component
170
180
} ,
171
181
key : notification , on : {
172
182
'close' : function close ( ) {
0 commit comments