This repository was archived by the owner on Apr 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
pages/manage/_team/api-keys Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -67,27 +67,35 @@ export default class CommaList extends Vue {
67
67
@Prop () autocomplete;
68
68
labelId = " " ;
69
69
list = [" " ];
70
-
71
- get commaList() {
72
- return this .list .filter (item => !! item ).join (" ," );
73
- }
70
+ commaList = " " ;
74
71
75
72
private created() {
76
73
this .labelId = Math .random ()
77
74
.toString (36 )
78
75
.substring (7 );
79
76
}
80
77
78
+ private mounted() {
79
+ if (this .value ) this .list = this .value .split (" ," );
80
+ }
81
+
81
82
private add() {
82
83
this .list .push (" " );
84
+ this .update ();
83
85
}
84
86
85
87
private remove(index ) {
86
88
this .list .splice (index , 1 );
89
+ this .update ();
87
90
}
88
91
89
92
private input(index , val ) {
90
93
this .list [index ] = val .target .value ;
94
+ this .update ();
95
+ }
96
+
97
+ private update() {
98
+ this .commaList = this .list .filter (item => !! item ).join (" ," );
91
99
this .$emit (" input" , this .commaList );
92
100
}
93
101
}
Original file line number Diff line number Diff line change 24
24
label =" IP restrictions"
25
25
:value =" apiKey.ipRestrictions"
26
26
placeholder =" Enter an IP address or CIDR, e.g., 192.168.1.1/42"
27
- @input ="
28
- val => {
29
- apiKey.ipRestrictions = val;
30
- $forceUpdate();
31
- }
32
- "
27
+ @input =" val => (apiKey.ipRestrictions = val)"
33
28
/>
34
- {{ apiKey.ipRestrictions }}
35
29
<CommaList
36
30
label =" Referrer restrictions"
37
31
:value =" apiKey.referrerRestrictions"
You can’t perform that action at this time.
0 commit comments