Skip to content

Commit e5e65cb

Browse files
committed
feat(ui): folder explorer: better loading indicator
1 parent 4b44509 commit e5e65cb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

packages/@vue/cli-ui/src/components/FolderExplorer.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,14 @@
138138
</div>
139139

140140
<div ref="folders" class="folders">
141-
<VueLoadingIndicator
142-
v-if="loading"
143-
class="overlay"
144-
/>
145-
<template v-else-if="folderCurrent.children">
141+
<transition name="vue-ui-fade">
142+
<VueLoadingBar
143+
v-if="loading"
144+
class="ghost primary"
145+
unknown
146+
/>
147+
</transition>
148+
<template v-if="folderCurrent && folderCurrent.children">
146149
<FolderExplorerItem
147150
v-for="folder of folderCurrent.children"
148151
v-if="showHidden || !folder.hidden"
@@ -261,6 +264,7 @@ export default {
261264
async openFolder (path) {
262265
this.editingPath = false
263266
this.error = null
267+
this.loading++
264268
try {
265269
await this.$apollo.mutate({
266270
mutation: FOLDER_OPEN,
@@ -274,11 +278,13 @@ export default {
274278
} catch (e) {
275279
this.error = e
276280
}
281+
this.loading--
277282
},
278283
279284
async openParentFolder (folder) {
280285
this.editingPath = false
281286
this.error = null
287+
this.loading++
282288
try {
283289
await this.$apollo.mutate({
284290
mutation: FOLDER_OPEN_PARENT,
@@ -289,6 +295,7 @@ export default {
289295
} catch (e) {
290296
this.error = e
291297
}
298+
this.loading--
292299
},
293300
294301
async toggleFavorite () {

0 commit comments

Comments
 (0)