Skip to content

Commit 85b6193

Browse files
committed
chore: RankingList to homepage of user
1 parent 9bddad1 commit 85b6193

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

apps/client/components/rank/RankingItem.vue

+17-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,30 @@
66
class="w-16"
77
:rank="rank"
88
/>
9-
<div class="flex-1 truncate text-center">{{ username || "匿名" }}</div>
9+
<div
10+
class="flex-1 cursor-pointer truncate text-center"
11+
@click="toUserHomePage"
12+
>
13+
{{ username || "匿名" }}
14+
</div>
1015
<div class="w-16 text-right">{{ count }} 课</div>
1116
</div>
1217
</template>
1318

1419
<script setup lang="ts">
15-
defineProps({
20+
import { useRouter } from "nuxt/app";
21+
22+
const props = defineProps({
1623
rank: Number,
1724
username: String,
1825
count: Number,
1926
});
27+
const router = useRouter();
28+
const toUserHomePage = () => {
29+
const { href } = router.resolve(`/user/${props.username}`);
30+
window.location.href = href;
31+
32+
//TODO: use route
33+
// router.push(`/user/${props.username}`);
34+
};
2035
</script>

0 commit comments

Comments
 (0)