diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-06 13:07:07 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-06 13:07:07 +0200 |
commit | 39c38c737114dc7f946b1895b2a4ba27a5546c60 (patch) | |
tree | 61344a90155845d08c4811da16e6f90504da2625 /packages/client/src/components/RepositoryTreeTree.vue | |
parent | 4102adab527ccc4f6d8ac210118dea21177c212d (diff) |
Migrated frontend to typescript
Diffstat (limited to 'packages/client/src/components/RepositoryTreeTree.vue')
-rw-r--r-- | packages/client/src/components/RepositoryTreeTree.vue | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/client/src/components/RepositoryTreeTree.vue b/packages/client/src/components/RepositoryTreeTree.vue index 821251e..a17dc93 100644 --- a/packages/client/src/components/RepositoryTreeTree.vue +++ b/packages/client/src/components/RepositoryTreeTree.vue @@ -47,10 +47,11 @@ </table> </template> -<script> -const { formatDistance } = require("date-fns"); +<script lang="ts"> +import { defineComponent } from "vue"; +import { formatDistance } from "date-fns"; -export default { +export default defineComponent({ name: "RepositoryTreeTree", props: { repository: { @@ -67,19 +68,19 @@ export default { } }, methods: { - stopClick(event) { + stopClick(event: Event) { event.preventDefault(); }, - routeToCommit(commit_id, event) { + routeToCommit(commit_id: string, event: Event) { event.stopPropagation(); event.preventDefault(); this.$router.push(`/${this.repository}/log/${commit_id}`); }, - getPrettyLastUpdated(date) { + getPrettyLastUpdated(date: number) { return formatDistance(new Date(date * 1000), new Date(), { addSuffix: true }); } } -}; +}); </script> <style lang="scss" scoped> |