You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:::demo A default Message cannot be closed manually. If you need a closable message, you can set `showClose` field. Besides, same as notification, message has a controllable `duration`. Default duration is 3000 ms, and it won't disappear when set to `0`.
Copy file name to clipboardExpand all lines: examples/docs/en-US/notification.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Displays a global notification message at a corner of the page.
10
10
<template>
11
11
<el-button
12
12
plain
13
-
@click="open">
13
+
@click="open1">
14
14
Closes automatically
15
15
</el-button>
16
16
<el-button
@@ -23,7 +23,7 @@ Displays a global notification message at a corner of the page.
23
23
<script>
24
24
exportdefault {
25
25
methods: {
26
-
open() {
26
+
open1() {
27
27
consth=this.$createElement;
28
28
29
29
this.$notify({
@@ -49,58 +49,58 @@ Displays a global notification message at a corner of the page.
49
49
50
50
We provide four types: success, warning, info and error.
51
51
52
-
:::demo Element provides four notification types: `success`, `warning`, `info` and `error`. They are set by the `type` field, and other values will be ignored. We also registered methods for these types that can be invoked directly like `open5` and `open6` without passing a `type` field.
52
+
:::demo Element provides four notification types: `success`, `warning`, `info` and `error`. They are set by the `type` field, and other values will be ignored. We also registered methods for these types that can be invoked directly like `open3` and `open4` without passing a `type` field.
53
53
```html
54
54
<template>
55
55
<el-button
56
56
plain
57
-
@click="open3">
57
+
@click="open1">
58
58
Success
59
59
</el-button>
60
60
<el-button
61
61
plain
62
-
@click="open4">
62
+
@click="open2">
63
63
Warning
64
64
</el-button>
65
65
<el-button
66
66
plain
67
-
@click="open5">
67
+
@click="open3">
68
68
Info
69
69
</el-button>
70
70
<el-button
71
71
plain
72
-
@click="open6">
72
+
@click="open4">
73
73
Error
74
74
</el-button>
75
75
</template>
76
76
77
77
<script>
78
78
exportdefault {
79
79
methods: {
80
-
open3() {
80
+
open1() {
81
81
this.$notify({
82
82
title:'Success',
83
83
message:'This is a success message',
84
84
type:'success'
85
85
});
86
86
},
87
87
88
-
open4() {
88
+
open2() {
89
89
this.$notify({
90
90
title:'Warning',
91
91
message:'This is a warning message',
92
92
type:'warning'
93
93
});
94
94
},
95
95
96
-
open5() {
96
+
open3() {
97
97
this.$notify.info({
98
98
title:'Info',
99
99
message:'This is an info message'
100
100
});
101
101
},
102
102
103
-
open6() {
103
+
open4() {
104
104
this.$notify.error({
105
105
title:'Error',
106
106
message:'This is an error message'
@@ -121,53 +121,53 @@ Notification can emerge from any corner you like.
121
121
<template>
122
122
<el-button
123
123
plain
124
-
@click="open7">
124
+
@click="open1">
125
125
Top Right
126
126
</el-button>
127
127
<el-button
128
128
plain
129
-
@click="open8">
129
+
@click="open2">
130
130
Bottom Right
131
131
</el-button>
132
132
<el-button
133
133
plain
134
-
@click="open9">
134
+
@click="open3">
135
135
Bottom Left
136
136
</el-button>
137
137
<el-button
138
138
plain
139
-
@click="open10">
139
+
@click="open4">
140
140
Top Left
141
141
</el-button>
142
142
</template>
143
143
144
144
<script>
145
145
exportdefault {
146
146
methods: {
147
-
open7() {
147
+
open1() {
148
148
this.$notify({
149
149
title:'Custom Position',
150
150
message:'I\'m at the top right corner'
151
151
});
152
152
},
153
153
154
-
open8() {
154
+
open2() {
155
155
this.$notify({
156
156
title:'Custom Position',
157
157
message:'I\'m at the bottom right corner',
158
158
position:'bottom-right'
159
159
});
160
160
},
161
161
162
-
open9() {
162
+
open3() {
163
163
this.$notify({
164
164
title:'Custom Position',
165
165
message:'I\'m at the bottom left corner',
166
166
position:'bottom-left'
167
167
});
168
168
},
169
169
170
-
open10() {
170
+
open4() {
171
171
this.$notify({
172
172
title:'Custom Position',
173
173
message:'I\'m at the top left corner',
@@ -189,15 +189,15 @@ Customize Notification's offset from the edge of the screen.
189
189
<template>
190
190
<el-button
191
191
plain
192
-
@click="open11">
192
+
@click="open">
193
193
Notification with offset
194
194
</el-button>
195
195
</template>
196
196
197
197
<script>
198
198
exportdefault {
199
199
methods: {
200
-
open11() {
200
+
open() {
201
201
this.$notify.success({
202
202
title:'Success',
203
203
message:'This is a success message',
@@ -218,15 +218,15 @@ Customize Notification's offset from the edge of the screen.
218
218
<template>
219
219
<el-button
220
220
plain
221
-
@click="open12">
221
+
@click="open">
222
222
Use HTML String
223
223
</el-button>
224
224
</template>
225
225
226
226
<script>
227
227
exportdefault {
228
228
methods: {
229
-
open12() {
229
+
open() {
230
230
this.$notify({
231
231
title:'HTML String',
232
232
dangerouslyUseHTMLString:true,
@@ -252,15 +252,15 @@ It is possible to hide the close button
:::demo Set `multiple` attribute for `el-select` to enable multiple mode. In this case, the value of `v-model` will be an array of selected options. By default the selected options will be displayed as Tags. You can collapse them to a text by using `collapse-tags` attribute.
0 commit comments