aboutsummaryrefslogtreecommitdiff
path: root/packages/client/src/views/RepositoryAbout.vue
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-06 13:07:07 +0200
committerHampusM <hampus@hampusmat.com>2021-07-06 13:07:07 +0200
commit39c38c737114dc7f946b1895b2a4ba27a5546c60 (patch)
tree61344a90155845d08c4811da16e6f90504da2625 /packages/client/src/views/RepositoryAbout.vue
parent4102adab527ccc4f6d8ac210118dea21177c212d (diff)
Migrated frontend to typescript
Diffstat (limited to 'packages/client/src/views/RepositoryAbout.vue')
-rw-r--r--packages/client/src/views/RepositoryAbout.vue26
1 files changed, 14 insertions, 12 deletions
diff --git a/packages/client/src/views/RepositoryAbout.vue b/packages/client/src/views/RepositoryAbout.vue
index 18855fe..ff96f53 100644
--- a/packages/client/src/views/RepositoryAbout.vue
+++ b/packages/client/src/views/RepositoryAbout.vue
@@ -13,14 +13,16 @@
</div>
</template>
-<script>
-import RepositoryTreeBlob from "@/components/RepositoryTreeBlob";
+<script lang="ts">
+import { defineComponent, Ref, ref } from "vue";
+import fetchData from "../util/fetch";
+
+import RepositoryTreeBlob from "../components/RepositoryTreeBlob.vue";
import Loading from "vue-loading-overlay";
-import BaseErrorMessage from "@/components/BaseErrorMessage";
-import { ref } from "vue";
-import fetchData from "@/util/fetch";
+import BaseErrorMessage from "../components/BaseErrorMessage.vue";
+import { getParam } from "../util/util";
-export default {
+export default defineComponent({
name: "RepositoryAbout",
components: {
RepositoryTreeBlob,
@@ -28,11 +30,11 @@ export default {
BaseErrorMessage
},
setup(props) {
- const readme = ref(null);
- const is_loading = ref(true);
- const fetch_failed = ref(null);
+ const readme: Ref<string | null> = ref(null);
+ const is_loading: Ref<boolean> = ref(true);
+ const fetch_failed: Ref<string> = ref("");
- const fetchReadme = async(repository) => {
+ const fetchReadme = async(repository: string) => {
const readme_data = await fetchData(`repos/${repository}/tree?path=README.md`, fetch_failed, is_loading, "tree");
if(readme_data) {
@@ -48,9 +50,9 @@ export default {
};
},
created() {
- this.fetchReadme(this.$router.currentRoute._rawValue.params.repo);
+ this.fetchReadme(getParam(this.$route.params, "repo"));
}
-};
+});
</script>
<style lang="scss" scoped>