Commit 85b6193 1 parent 9bddad1 commit 85b6193 Copy full SHA for 85b6193
File tree 1 file changed +17
-2
lines changed
apps/client/components/rank
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 6
6
class =" w-16"
7
7
:rank =" rank"
8
8
/>
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 >
10
15
<div class =" w-16 text-right" >{{ count }} 课</div >
11
16
</div >
12
17
</template >
13
18
14
19
<script setup lang="ts">
15
- defineProps ({
20
+ import { useRouter } from " nuxt/app" ;
21
+
22
+ const props = defineProps ({
16
23
rank: Number ,
17
24
username: String ,
18
25
count: Number ,
19
26
});
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
+ };
20
35
</script >
You can’t perform that action at this time.
0 commit comments