perf(ChangeLog): update error alert

This commit is contained in:
thehrz 2023-07-21 18:27:55 +08:00
parent e0dd9e64fa
commit 857435b2b1
Signed by: thehrz
GPG Key ID: C84CBCE7D5F88855

View File

@ -10,7 +10,7 @@ interface Commit {
} }
} }
const { isFetching, data } = useFetch('https://git.thehrz.net/api/v1/repos/19yuke2-project/19yuke2/commits?stat=false&limit=3').json<Commit[]>() const { isFetching, error, data } = useFetch('https://git.thehrz.net/api/v1/repos/19yuke2-project/19yuke2/commits?stat=false&limit=3').json<Commit[]>()
</script> </script>
<template> <template>
@ -18,6 +18,14 @@ const { isFetching, data } = useFetch('https://git.thehrz.net/api/v1/repos/19yuk
<p v-if="isFetching"> <p v-if="isFetching">
Loading... Loading...
</p> </p>
<v-alert
v-else-if="error"
type="error"
title="加载错误"
text="无法加载ChangeLog请刷新重试。"
/>
<v-list v-else> <v-list v-else>
<v-list-item <v-list-item
v-for="commit in data" v-for="commit in data"