diff options
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> |