Skip to content

Commit b240f0e

Browse files
liuplziyoung
authored andcommitted
Docs: Rename variable in docs (#15185)
1 parent 8bb1e0a commit b240f0e

29 files changed

+278
-279
lines changed

examples/docs/en-US/message.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ Used to show the feedback of Success, Warning, Message and Error activities.
4545
<template>
4646
<el-button :plain="true" @click="open2">success</el-button>
4747
<el-button :plain="true" @click="open3">warning</el-button>
48-
<el-button :plain="true" @click="open">message</el-button>
48+
<el-button :plain="true" @click="open1">message</el-button>
4949
<el-button :plain="true" @click="open4">error</el-button>
5050
</template>
5151

5252
<script>
5353
export default {
5454
methods: {
55-
open() {
55+
open1() {
5656
this.$message('This is a message.');
5757
},
5858
open2() {
@@ -85,39 +85,39 @@ A close button can be added.
8585
:::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`.
8686
```html
8787
<template>
88-
<el-button :plain="true" @click="open5">message</el-button>
89-
<el-button :plain="true" @click="open6">success</el-button>
90-
<el-button :plain="true" @click="open7">warning</el-button>
91-
<el-button :plain="true" @click="open8">error</el-button>
88+
<el-button :plain="true" @click="open1">message</el-button>
89+
<el-button :plain="true" @click="open2">success</el-button>
90+
<el-button :plain="true" @click="open3">warning</el-button>
91+
<el-button :plain="true" @click="open4">error</el-button>
9292
</template>
9393

9494
<script>
9595
export default {
9696
methods: {
97-
open5() {
97+
open1() {
9898
this.$message({
9999
showClose: true,
100100
message: 'This is a message.'
101101
});
102102
},
103103
104-
open6() {
104+
open2() {
105105
this.$message({
106106
showClose: true,
107107
message: 'Congrats, this is a success message.',
108108
type: 'success'
109109
});
110110
},
111111
112-
open7() {
112+
open3() {
113113
this.$message({
114114
showClose: true,
115115
message: 'Warning, this is a warning message.',
116116
type: 'warning'
117117
});
118118
},
119119
120-
open8() {
120+
open4() {
121121
this.$message({
122122
showClose: true,
123123
message: 'Oops, this is a error message.',

examples/docs/en-US/notification.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Displays a global notification message at a corner of the page.
1010
<template>
1111
<el-button
1212
plain
13-
@click="open">
13+
@click="open1">
1414
Closes automatically
1515
</el-button>
1616
<el-button
@@ -23,7 +23,7 @@ Displays a global notification message at a corner of the page.
2323
<script>
2424
export default {
2525
methods: {
26-
open() {
26+
open1() {
2727
const h = this.$createElement;
2828
2929
this.$notify({
@@ -49,58 +49,58 @@ Displays a global notification message at a corner of the page.
4949

5050
We provide four types: success, warning, info and error.
5151

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.
5353
```html
5454
<template>
5555
<el-button
5656
plain
57-
@click="open3">
57+
@click="open1">
5858
Success
5959
</el-button>
6060
<el-button
6161
plain
62-
@click="open4">
62+
@click="open2">
6363
Warning
6464
</el-button>
6565
<el-button
6666
plain
67-
@click="open5">
67+
@click="open3">
6868
Info
6969
</el-button>
7070
<el-button
7171
plain
72-
@click="open6">
72+
@click="open4">
7373
Error
7474
</el-button>
7575
</template>
7676

7777
<script>
7878
export default {
7979
methods: {
80-
open3() {
80+
open1() {
8181
this.$notify({
8282
title: 'Success',
8383
message: 'This is a success message',
8484
type: 'success'
8585
});
8686
},
8787
88-
open4() {
88+
open2() {
8989
this.$notify({
9090
title: 'Warning',
9191
message: 'This is a warning message',
9292
type: 'warning'
9393
});
9494
},
9595
96-
open5() {
96+
open3() {
9797
this.$notify.info({
9898
title: 'Info',
9999
message: 'This is an info message'
100100
});
101101
},
102102
103-
open6() {
103+
open4() {
104104
this.$notify.error({
105105
title: 'Error',
106106
message: 'This is an error message'
@@ -121,53 +121,53 @@ Notification can emerge from any corner you like.
121121
<template>
122122
<el-button
123123
plain
124-
@click="open7">
124+
@click="open1">
125125
Top Right
126126
</el-button>
127127
<el-button
128128
plain
129-
@click="open8">
129+
@click="open2">
130130
Bottom Right
131131
</el-button>
132132
<el-button
133133
plain
134-
@click="open9">
134+
@click="open3">
135135
Bottom Left
136136
</el-button>
137137
<el-button
138138
plain
139-
@click="open10">
139+
@click="open4">
140140
Top Left
141141
</el-button>
142142
</template>
143143

144144
<script>
145145
export default {
146146
methods: {
147-
open7() {
147+
open1() {
148148
this.$notify({
149149
title: 'Custom Position',
150150
message: 'I\'m at the top right corner'
151151
});
152152
},
153153
154-
open8() {
154+
open2() {
155155
this.$notify({
156156
title: 'Custom Position',
157157
message: 'I\'m at the bottom right corner',
158158
position: 'bottom-right'
159159
});
160160
},
161161
162-
open9() {
162+
open3() {
163163
this.$notify({
164164
title: 'Custom Position',
165165
message: 'I\'m at the bottom left corner',
166166
position: 'bottom-left'
167167
});
168168
},
169169
170-
open10() {
170+
open4() {
171171
this.$notify({
172172
title: 'Custom Position',
173173
message: 'I\'m at the top left corner',
@@ -189,15 +189,15 @@ Customize Notification's offset from the edge of the screen.
189189
<template>
190190
<el-button
191191
plain
192-
@click="open11">
192+
@click="open">
193193
Notification with offset
194194
</el-button>
195195
</template>
196196

197197
<script>
198198
export default {
199199
methods: {
200-
open11() {
200+
open() {
201201
this.$notify.success({
202202
title: 'Success',
203203
message: 'This is a success message',
@@ -218,15 +218,15 @@ Customize Notification's offset from the edge of the screen.
218218
<template>
219219
<el-button
220220
plain
221-
@click="open12">
221+
@click="open">
222222
Use HTML String
223223
</el-button>
224224
</template>
225225

226226
<script>
227227
export default {
228228
methods: {
229-
open12() {
229+
open() {
230230
this.$notify({
231231
title: 'HTML String',
232232
dangerouslyUseHTMLString: true,
@@ -252,15 +252,15 @@ It is possible to hide the close button
252252
<template>
253253
<el-button
254254
plain
255-
@click="open13">
255+
@click="open">
256256
Hide close button
257257
</el-button>
258258
</template>
259259

260260
<script>
261261
export default {
262262
methods: {
263-
open13() {
263+
open() {
264264
this.$notify.success({
265265
title: 'Info',
266266
message: 'This is a message without close button',

examples/docs/en-US/popover.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ Of course, you can nest other operations. It's more light-weight than using a di
115115
<el-popover
116116
placement="top"
117117
width="160"
118-
v-model="visible2">
118+
v-model="visible">
119119
<p>Are you sure to delete this?</p>
120120
<div style="text-align: right; margin: 0">
121-
<el-button size="mini" type="text" @click="visible2 = false">cancel</el-button>
122-
<el-button type="primary" size="mini" @click="visible2 = false">confirm</el-button>
121+
<el-button size="mini" type="text" @click="visible = false">cancel</el-button>
122+
<el-button type="primary" size="mini" @click="visible = false">confirm</el-button>
123123
</div>
124124
<el-button slot="reference">Delete</el-button>
125125
</el-popover>
@@ -128,7 +128,7 @@ Of course, you can nest other operations. It's more light-weight than using a di
128128
export default {
129129
data() {
130130
return {
131-
visible2: false,
131+
visible: false,
132132
};
133133
}
134134
}

examples/docs/en-US/select.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Multiple select uses tags to display selected options.
189189
:::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.
190190
```html
191191
<template>
192-
<el-select v-model="value5" multiple placeholder="Select">
192+
<el-select v-model="value1" multiple placeholder="Select">
193193
<el-option
194194
v-for="item in options"
195195
:key="item.value"
@@ -199,7 +199,7 @@ Multiple select uses tags to display selected options.
199199
</el-select>
200200

201201
<el-select
202-
v-model="value11"
202+
v-model="value2"
203203
multiple
204204
collapse-tags
205205
style="margin-left: 20px;"
@@ -233,8 +233,8 @@ Multiple select uses tags to display selected options.
233233
value: 'Option5',
234234
label: 'Option5'
235235
}],
236-
value5: [],
237-
value11: []
236+
value1: [],
237+
value2: []
238238
}
239239
}
240240
}

examples/docs/en-US/switch.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ Switch is used for switching between two opposing states.
3232

3333
```html
3434
<el-switch
35-
v-model="value3"
35+
v-model="value1"
3636
active-text="Pay by month"
3737
inactive-text="Pay by year">
3838
</el-switch>
3939
<el-switch
4040
style="display: block"
41-
v-model="value4"
41+
v-model="value2"
4242
active-color="#13ce66"
4343
inactive-color="#ff4949"
4444
active-text="Pay by month"
@@ -49,8 +49,8 @@ Switch is used for switching between two opposing states.
4949
export default {
5050
data() {
5151
return {
52-
value3: true,
53-
value4: true
52+
value1: true,
53+
value2: true
5454
}
5555
}
5656
};
@@ -63,9 +63,9 @@ Switch is used for switching between two opposing states.
6363
:::demo You can set `active-value` and `inactive-value` attributes. They both receive a `Boolean`, `String` or `Number` typed value.
6464

6565
```html
66-
<el-tooltip :content="'Switch value: ' + value5" placement="top">
66+
<el-tooltip :content="'Switch value: ' + value" placement="top">
6767
<el-switch
68-
v-model="value5"
68+
v-model="value"
6969
active-color="#13ce66"
7070
inactive-color="#ff4949"
7171
active-value="100"
@@ -77,7 +77,7 @@ Switch is used for switching between two opposing states.
7777
export default {
7878
data() {
7979
return {
80-
value5: '100'
80+
value: '100'
8181
}
8282
}
8383
};
@@ -92,20 +92,20 @@ Switch is used for switching between two opposing states.
9292

9393
```html
9494
<el-switch
95-
v-model="value6"
95+
v-model="value1"
9696
disabled>
9797
</el-switch>
9898
<el-switch
99-
v-model="value7"
99+
v-model="value2"
100100
disabled>
101101
</el-switch>
102102

103103
<script>
104104
export default {
105105
data() {
106106
return {
107-
value6: true,
108-
value7: false
107+
value1: true,
108+
value2: false
109109
}
110110
}
111111
};

0 commit comments

Comments
 (0)