Skip to content

Commit

Permalink
feat(footer): add auto version getter
Browse files Browse the repository at this point in the history
  • Loading branch information
txuyuan committed Aug 24, 2022
1 parent 83d57cd commit dcf8ef4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion components/footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<hr />

<p>Aquarium Insider <strong>v1.0.2</strong></p>
<p>Aquarium Insider <strong>{{ latestVersion }}</strong></p>

<div class="copyright">
© 2022 Aquarium Insider Team
Expand Down Expand Up @@ -122,4 +122,16 @@ footer {
<script setup>
import InstagramIcon from "vue-material-design-icons/Instagram.vue";
import EmailIcon from "vue-material-design-icons/Email.vue";
import { ref, onMounted } from "vue";
const latestVersion = ref("")
onMounted(() => {
fetch("https://api.github.com/repos/txuyuan/AquariumInsider-Web/releases/latest")
.then((resp) => resp.json())
.then((data) => {
this.latestVersion = data.tag_name;
});
})
</script>

1 comment on commit dcf8ef4

@vercel
Copy link

@vercel vercel bot commented on dcf8ef4 Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

aquariuminsider – ./

aquariuminsider-git-master-txuyuan.vercel.app
aquariuminsider-txuyuan.vercel.app
aquariuminsider.org

Please sign in to comment.