1
1
/*!
2
- * vue-notifyjs v0.1.3
2
+ * vue-notifyjs v0.1.4
3
3
* (c) 2017-present cristij <[email protected] >
4
4
* Released under the MIT License.
5
5
*/
@@ -35,6 +35,9 @@ var Notification = {
35
35
default : function _default ( ) {
36
36
return new Date ( ) ;
37
37
}
38
+ } ,
39
+ component : {
40
+ type : [ Object , Function ]
38
41
}
39
42
} ,
40
43
data : function data ( ) {
@@ -82,19 +85,21 @@ var Notification = {
82
85
setTimeout ( this . close , this . timeout ) ;
83
86
}
84
87
} ,
85
- render : function render ( ) {
86
- var h = arguments [ 0 ] ;
87
-
88
+ render : function render ( h ) {
89
+ var componentName = this . component ;
88
90
return h (
89
91
'div' ,
90
92
{
93
+ on : {
94
+ 'click' : this . close
95
+ } ,
91
96
attrs : {
92
97
'data-notify' : 'container' ,
93
98
94
99
role : 'alert' ,
95
100
96
101
'data-notify-position' : 'top-center' } ,
97
- 'class' : [ 'col-xs-11 col-sm-4 alert open ' , { 'alert-with-icon' : this . icon } , this . verticalAlign , this . horizontalAlign , this . alertType ] , style : this . customPosition } ,
102
+ 'class' : [ 'alert open ' , { 'alert-with-icon' : this . icon } , this . verticalAlign , this . horizontalAlign , this . alertType ] , style : this . customPosition } ,
98
103
[ h (
99
104
'button' ,
100
105
{
@@ -120,7 +125,11 @@ var Notification = {
120
125
{
121
126
attrs : { 'data-notify' : 'message' }
122
127
} ,
123
- [ this . message ]
128
+ [ this . message !== undefined && this . message , this . component !== undefined && h (
129
+ this . component ,
130
+ null ,
131
+ [ ]
132
+ ) ]
124
133
) ]
125
134
) ;
126
135
}
@@ -170,7 +179,8 @@ var Notifications = {
170
179
icon : notification . icon ,
171
180
message : notification . message ,
172
181
timeout : notification . timeout ,
173
- type : notification . type
182
+ type : notification . type ,
183
+ component : notification . component
174
184
} ,
175
185
key : notification , on : {
176
186
'close' : function close ( ) {
0 commit comments