emojy: sort the emojy list page

This commit is contained in:
Chris Sexton 2022-07-23 09:46:31 -04:00
parent 4c1a02e9fb
commit 668b0dcb7b
1 changed files with 5 additions and 2 deletions

View File

@ -44,8 +44,8 @@
</div> </div>
<div class="row row-cols-5"> <div class="row row-cols-5">
<div class="card text-center" v-for="(path, name) in fileList" key="name"> <div class="card text-center" v-for="name in fileKeys" key="name">
<img :src="path" class="card-img-top mx-auto d-block" :alt="name" style="max-width: 100px"> <img :src="fileList[name]" class="card-img-top mx-auto d-block" :alt="name" style="max-width: 100px">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">{{name}}</h5> <h5 class="card-title">{{name}}</h5>
</div> </div>
@ -62,6 +62,7 @@
view: '', view: '',
nav: [], nav: [],
results: [], results: [],
fileKeys: [],
fileList: {}, fileList: {},
image: null, image: null,
password: '' password: ''
@ -90,6 +91,8 @@
.catch(err => (this.err = err)) .catch(err => (this.err = err))
axios.get('/emojy/allFiles') axios.get('/emojy/allFiles')
.then(resp => { .then(resp => {
// stole this somewhere or other as a quick hack
this.fileKeys = Object.keys(resp.data).sort()
this.fileList = resp.data this.fileList = resp.data
this.err = '' this.err = ''
}) })