mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
🚸 活动icon点击事件,调整类型声明
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
<div class="ph-pool-card">
|
||||
<div class="top">
|
||||
<div class="main">
|
||||
<div class="left"><img :src="props.position.icon" alt="icon" /></div>
|
||||
<div class="left" @click="openPosition(props.position)">
|
||||
<img :src="props.position.icon" alt="icon" />
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="title">{{ props.position.title }}</div>
|
||||
<div class="sub">{{ props.position.abstract }}</div>
|
||||
@@ -48,11 +50,15 @@ const props = defineProps<PhPositionCardProps>();
|
||||
|
||||
async function openPosition(card: TGApp.Plugins.Mys.Position.RenderCard): Promise<void> {
|
||||
const res = await parseLink(card.link);
|
||||
if (res === "post") await createPost(card.postId, card.title);
|
||||
if (res === "post") {
|
||||
await createPost(card.postId, card.title);
|
||||
return;
|
||||
}
|
||||
if (res === false) {
|
||||
showSnackbar.warn(`未知链接:${card.link}`, 3000);
|
||||
return;
|
||||
}
|
||||
window.open(card.link);
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
|
||||
Reference in New Issue
Block a user