Implement snippets page
This commit is contained in:
parent
96db50764d
commit
3d1007aa30
@ -1,5 +1,27 @@
|
||||
<template>
|
||||
<div class="about">
|
||||
<h1>This is an about page</h1>
|
||||
</div>
|
||||
<snippet-list :snippets="recentSnippets" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Options, Vue } from "vue-class-component";
|
||||
|
||||
import SnippetList from "@/components/snippets/SnippetList.vue";
|
||||
|
||||
import snippets from "@/data/snippets.json";
|
||||
import Snippet from "@/interfaces/Snippet";
|
||||
|
||||
@Options({
|
||||
components: {
|
||||
SnippetList,
|
||||
},
|
||||
})
|
||||
export default class HomeView extends Vue {
|
||||
private snippets: Snippet[] = snippets;
|
||||
|
||||
get recentSnippets() {
|
||||
return this.snippets
|
||||
.sort((a, b) => a.timeAdded - b.timeAdded)
|
||||
.slice(0, 10);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user