Skip to content

Commit 76248bb

Browse files
committed
sort numbers and add image
1 parent eeab65c commit 76248bb

File tree

4 files changed

+544
-5
lines changed

4 files changed

+544
-5
lines changed

website/pages/random.vue

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
</v-col>
3535
</v-row>
3636

37-
<v-row>
38-
<v-col cols="12">
37+
<v-row class="fill-height" align="center" justify="center">
38+
<v-col v-if="results.length > 0" cols="12">
3939
<v-chip
40-
v-for="n in results"
40+
v-for="n in sortedResults"
4141
:key="n"
4242
color="cyan lighten-3"
4343
label
@@ -47,6 +47,10 @@
4747
{{ n }}
4848
</v-chip>
4949
</v-col>
50+
51+
<v-col v-else cols="12" class="mt-16">
52+
<v-img height="100%" src="/analytics.svg"></v-img>
53+
</v-col>
5054
</v-row>
5155
</div>
5256
</template>
@@ -57,10 +61,17 @@ export default {
5761
return {
5862
total: null,
5963
randomNumbers: null,
60-
results: [],
64+
results: [].sort(),
6165
}
6266
},
63-
computed: {},
67+
computed: {
68+
sortedResults() {
69+
const results = this.results.slice()
70+
return results.sort(function (a, b) {
71+
return a - b
72+
})
73+
},
74+
},
6475
methods: {
6576
getRandomNumber(results) {
6677
this.results = []

website/static/analytics.svg

Lines changed: 330 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)