File tree 1 file changed +38
-18
lines changed
1 file changed +38
-18
lines changed Original file line number Diff line number Diff line change @@ -136,25 +136,45 @@ const items = [[{
136
136
>
137
137
< span class = " flex-1 font-medium" > {{ entry .key }}< / span>
138
138
139
- < span v- if = " editedEntryKey !== entry.key" class = " flex-1 font-medium" > {{ entry .value }}< / span>
140
- < UInput v- else v- model= " editedEntryValue" name= " editedValue" variant= " none" size= " xl" autofocus : padded= " false" class = " flex-1" @keypress .enter = " updateEntry(entry)" / >
141
139
142
- < UButton
143
- v- if = " editedEntryKey !== entry.key"
144
- variant= " ghost"
145
- size= " 2xs"
146
- icon= " i-heroicons-pencil"
147
- class = " flex-shrink-0"
148
- @click= " editEntry(entry)"
149
- / >
150
- < UButton
151
- v- else
152
- variant= " ghost"
153
- size= " 2xs"
154
- icon= " i-heroicons-x-mark"
155
- class = " flex-shrink-0"
156
- @click= " editedEntryKey = null"
157
- / >
140
+ < div class = " flex-1 flex items-center" >
141
+ < span v- if = " editedEntryKey !== entry.key" class = " flex-1 font-medium" > {{ entry .value }}< / span>
142
+ < UInput
143
+ v- else
144
+ v- model= " editedEntryValue"
145
+ name= " editedValue"
146
+ variant= " none"
147
+ size= " xl"
148
+ autofocus
149
+ : padded= " false"
150
+ class = " flex-1"
151
+ @keydown .enter = " updateEntry(entry)"
152
+ @keydown .esc = " editedEntryKey = null"
153
+ / >
154
+
155
+ < UButton
156
+ v- if = " editedEntryKey !== entry.key"
157
+ variant= " ghost"
158
+ size= " 2xs"
159
+ icon= " i-heroicons-pencil"
160
+ class = " flex-shrink-0"
161
+ @click= " editEntry(entry)"
162
+ / >
163
+ < div v- else class = " flex-shrink-0 flex gap-1" >
164
+ < UButton
165
+ variant= " ghost"
166
+ size= " 2xs"
167
+ icon= " i-heroicons-check"
168
+ @click= " updateEntry(entry)"
169
+ / >
170
+ < UButton
171
+ variant= " ghost"
172
+ size= " 2xs"
173
+ icon= " i-heroicons-x-mark"
174
+ @click= " editedEntryKey = null"
175
+ / >
176
+ < / div>
177
+ < / div>
158
178
159
179
< UButton
160
180
color= " red"
You can’t perform that action at this time.
0 commit comments