mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-15 03:53:16 +08:00
🏷️ add await
This commit is contained in:
@@ -63,7 +63,7 @@ onBeforeMount(async () => {
|
||||
console.log(next.value);
|
||||
});
|
||||
|
||||
function toBirth(type: TGApp.Archive.Birth.RoleItem | true): void {
|
||||
async function toBirth(type: TGApp.Archive.Birth.RoleItem | true): Promise<void> {
|
||||
let dateStr;
|
||||
if (type === true) {
|
||||
const date = new Date();
|
||||
@@ -74,15 +74,15 @@ function toBirth(type: TGApp.Archive.Birth.RoleItem | true): void {
|
||||
dateStr = type.role_birthday;
|
||||
}
|
||||
if (type !== true) {
|
||||
router.push({ name: "留影叙佳期", params: { date: dateStr } });
|
||||
await router.push({ name: "留影叙佳期", params: { date: dateStr } });
|
||||
return;
|
||||
}
|
||||
if (cur.value.length > 0 && !cur.value[0].is_subscribe) {
|
||||
recentNewsType.value = "news";
|
||||
router.push("/news/2/news");
|
||||
await router.push("/news/2/news");
|
||||
return;
|
||||
}
|
||||
router.push({ name: "留影叙佳期", params: { date: dateStr } });
|
||||
await router.push({ name: "留影叙佳期", params: { date: dateStr } });
|
||||
}
|
||||
|
||||
function parseDesc(intro: string): string {
|
||||
|
||||
@@ -107,7 +107,7 @@ async function toPost(postId: string, index: number): Promise<void> {
|
||||
showSnackbar.warn("已经在当前帖子");
|
||||
return;
|
||||
}
|
||||
router.push({ name: "帖子详情", params: { post_id: postId } });
|
||||
await router.push({ name: "帖子详情", params: { post_id: postId } });
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
|
||||
@@ -272,7 +272,7 @@ async function getCurrentPosts(
|
||||
|
||||
async function freshPostData(): Promise<void> {
|
||||
if (!selectedForum.value) return;
|
||||
router.push({
|
||||
await router.push({
|
||||
name: "酒馆",
|
||||
params: route.params,
|
||||
query: { gid: curGid.value, forum: selectedForum.value.value },
|
||||
|
||||
@@ -123,7 +123,7 @@ async function firstLoad(key: NewsType, refresh: boolean = false): Promise<void>
|
||||
|
||||
async function switchAnno(): Promise<void> {
|
||||
await TGLogger.Info(`[News][${gid}][switchAnno] 切换公告`);
|
||||
router.push("/announcements");
|
||||
await router.push("/announcements");
|
||||
}
|
||||
|
||||
// 加载更多
|
||||
|
||||
Reference in New Issue
Block a user