🐛 修复useRouter无效

This commit is contained in:
目棃
2024-08-17 21:25:12 +08:00
parent 6bfa1b3cb4
commit 6aeecd2233
2 changed files with 4 additions and 10 deletions

View File

@@ -21,7 +21,6 @@
</template>
<script lang="ts" setup>
import { onMounted, ref, StyleValue, toRaw } from "vue";
import { useRouter } from "vue-router";
import { getEmojis } from "../../plugins/Mys/request/getEmojis.js";
import { parseLink, parsePost } from "../../utils/linkParser.js";
@@ -99,12 +98,7 @@ async function toLink() {
const link = props.data.attributes.link;
const isPost = await parsePost(link);
if (isPost !== false) {
await useRouter().push({
name: "帖子详情",
params: {
post_id: isPost,
},
});
location.href = `/post_detail/${isPost}`;
return;
}
const res = await parseLink(link);