feat: Add skeleton to Home and Sidebar

This commit is contained in:
Faris Ansari
2018-09-03 19:39:19 +05:30
parent 1265a26c0c
commit 66321e6af7
2 changed files with 22 additions and 2 deletions

View File

@@ -9,7 +9,10 @@
<li class="hub-sidebar-item is-title bold text-muted">
{{ __('Categories') }}
</li>
<li class="hub-sidebar-item" v-for="category in categories" :key="category.label" v-route="category.route">
<li v-if="show_skeleton" class="hub-skeleton hub-sidebar-item" v-for="(c, $index) in [1, 2, 3, 4, 5, 6, 7]" :key="$index">
Category
</li>
<li class="hub-sidebar-item" v-else v-for="category in categories" :key="category.label" v-route="category.route">
{{ category.label }}
</li>
</ul>
@@ -57,11 +60,14 @@ export default {
},
],
categories: [],
show_skeleton: true
}
},
created() {
this.get_categories()
.then(categories => {
this.show_skeleton = false;
this.categories = categories.map(c => {
return {
label: __(c.name),