mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-04-21 11:27:27 +08:00
feat: add refresh home
This commit is contained in:
@@ -127,6 +127,7 @@ const goToNewPost = () => {
|
|||||||
|
|
||||||
const refrechData = async () => {
|
const refrechData = async () => {
|
||||||
await fetchUnreadCount()
|
await fetchUnreadCount()
|
||||||
|
window.dispatchEvent(new Event('refresh-home'))
|
||||||
}
|
}
|
||||||
|
|
||||||
const headerMenuItems = computed(() => [
|
const headerMenuItems = computed(() => [
|
||||||
|
|||||||
@@ -351,6 +351,8 @@ if (import.meta.server) {
|
|||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (categoryOptions.value.length === 0 && tagOptions.value.length === 0) loadOptions()
|
if (categoryOptions.value.length === 0 && tagOptions.value.length === 0) loadOptions()
|
||||||
|
|
||||||
|
window.addEventListener('refresh-home', refreshFirst)
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 其他工具函数 **/
|
/** 其他工具函数 **/
|
||||||
@@ -381,7 +383,6 @@ const sanitizeDescription = (text) => stripMarkdown(text)
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.loading-container {
|
.loading-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user