Skip to content

Commit

Permalink
feat: modify loading interface for MirrorList #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Iori Ichinose committed Dec 5, 2021
1 parent 114d2f8 commit 4b4e2fc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/MirrorList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function StatusTag({ data }: { data: SyncEntry }) {
}
const filter = ref('');
const loading = ref(true);
const extraColumns = computed(() => store.state.isMobile ? [] : [
{
title: 'Size',
Expand Down Expand Up @@ -114,16 +115,20 @@ const columns = reactive([
] as DataTableColumn<SyncEntry>[]);
onMounted(() => fetchEntries().then(
res => entries.value = res.sort(
(a, b) => a.name.localeCompare(b.name)
),
res => {
entries.value = res.sort(
(a, b) => a.name.localeCompare(b.name)
);
loading.value = false;
},
err => message.error(err.message)
));
</script>

<template>
<n-data-table
size="small"
:loading="loading"
:columns="columns.concat(extraColumns)"
:data="entries"
max-height="calc(100vh - 12.125rem)"
Expand Down

0 comments on commit 4b4e2fc

Please sign in to comment.