File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ Interactive password strength meter based on [zxcvbn](https://github.com/dropbox
74
74
### With custom input
75
75
76
76
``` html
77
-
78
77
<template >
79
78
<div >
80
79
<input type =" password" v-model =" password" >
@@ -113,6 +112,8 @@ Interactive password strength meter based on [zxcvbn](https://github.com/dropbox
113
112
| strengthMeterFillClass | String | Password__ strength-meter--fill | strength-meter class for individual data fills |
114
113
| showStrengthMeter | Boolean | true | Hide the Strength Meter if you want to implement your own |
115
114
| strengthMeterOnly | Boolean | false | Hides the built-in input if you want to implement your own |
115
+ | labelHide | String | 'Hide Password' | Label for the hide icon
116
+ | labelShow | String | 'Show Password' | Label for the show icon
116
117
117
118
## Events
118
119
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" Password" >
3
3
<div
4
- v-if =" !strengthMeterOnly"
4
+ v-if =" !strengthMeterOnly"
5
5
class =" Password__group"
6
6
>
7
7
<input
34
34
:aria-label =" showPasswordLabel"
35
35
@click.prevent =" togglePassword()" >
36
36
<svg v-if =" this.$data._showPassword" version =" 1.1" xmlns =" http://www.w3.org/2000/svg" width =" 24" height =" 24" viewBox =" 0 0 24 24" >
37
- <title >Hide Password </title >
37
+ <title >{{showPasswordLabel}} </title >
38
38
<path d =" M12 9c1.641 0 3 1.359 3 3s-1.359 3-3 3-3-1.359-3-3 1.359-3 3-3zM12 17.016c2.766 0 5.016-2.25 5.016-5.016s-2.25-5.016-5.016-5.016-5.016 2.25-5.016 5.016 2.25 5.016 5.016 5.016zM12 4.5c5.016 0 9.281 3.094 11.016 7.5-1.734 4.406-6 7.5-11.016 7.5s-9.281-3.094-11.016-7.5c1.734-4.406 6-7.5 11.016-7.5z" ></path >
39
39
</svg >
40
40
<svg v-else version =" 1.1" xmlns =" http://www.w3.org/2000/svg" width =" 24" height =" 24" viewBox =" 0 0 24 24" >
41
- <title >Show Password </title >
41
+ <title >{{showPasswordLabel}} </title >
42
42
<path d =" M11.859 9h0.141c1.641 0 3 1.359 3 3v0.188zM7.547 9.797c-0.328 0.656-0.563 1.406-0.563 2.203 0 2.766 2.25 5.016 5.016 5.016 0.797 0 1.547-0.234 2.203-0.563l-1.547-1.547c-0.188 0.047-0.422 0.094-0.656 0.094-1.641 0-3-1.359-3-3 0-0.234 0.047-0.469 0.094-0.656zM2.016 4.266l1.266-1.266 17.719 17.719-1.266 1.266c-1.124-1.11-2.256-2.213-3.375-3.328-1.359 0.563-2.813 0.844-4.359 0.844-5.016 0-9.281-3.094-11.016-7.5 0.797-1.969 2.109-3.656 3.75-4.969-0.914-0.914-1.812-1.844-2.719-2.766zM12 6.984c-0.656 0-1.266 0.141-1.828 0.375l-2.156-2.156c1.219-0.469 2.578-0.703 3.984-0.703 5.016 0 9.234 3.094 10.969 7.5-0.75 1.875-1.922 3.469-3.422 4.734l-2.906-2.906c0.234-0.563 0.375-1.172 0.375-1.828 0-2.766-2.25-5.016-5.016-5.016z" ></path >
43
43
</svg >
44
44
</button >
225
225
strengthMeterFillClass: {
226
226
type: String ,
227
227
default: ' Password__strength-meter--fill'
228
+ },
229
+ /**
230
+ * Label for the show password icon
231
+ */
232
+ labelShow: {
233
+ type: String ,
234
+ default: ' Show Password'
235
+ },
236
+ /**
237
+ * Label for the hide password icon
238
+ */
239
+ labelHide: {
240
+ type: String ,
241
+ default: ' Hide Password'
228
242
}
229
243
},
230
244
data () {
294
308
},
295
309
296
310
showPasswordLabel () {
297
- return this .$data ._showPassword || this .showPassword ? ' Hide password ' : ' Show password '
311
+ return this .$data ._showPassword || this .showPassword ? this . labelHide : this . labelShow
298
312
}
299
313
},
300
314
You can’t perform that action at this time.
0 commit comments