feat: 新增个人页面跳转功能

This commit is contained in:
陈淳
2024-01-17 16:31:01 +08:00
parent 0d5c196f39
commit 98a4a2158a
17 changed files with 139 additions and 43 deletions

View File

@@ -9,12 +9,12 @@
v-if="!props.isSelf"
>
<template #reference>
<el-avatar :size="30" :src="iconUrl" />
<el-avatar :size="30" :src="iconUrl" />
</template>
<div class="top">
<div class="left">
<div class="image">
<img :src="iconUrl" alt="" />
<img :src="iconUrl" alt="" @click="gotoProfile(userInfo.userName)" style="cursor: pointer;" />
</div>
</div>
<div class="right">
@@ -64,7 +64,7 @@
<script setup name="UserInfoCard">
import { computed, defineProps } from "vue";
import { useRouter } from "vue-router";
const props = defineProps({
// 用户信息
userInfo: {
@@ -77,9 +77,8 @@ const props = defineProps({
default: () => "",
},
});
const router = useRouter();
const userInfo = computed(() => props.userInfo);
const statusTypeList = [
{
label: "正常",
@@ -100,6 +99,11 @@ const statusTypeList = [
const getStatusInfo = (type) => {
return statusTypeList.filter((item) => item.value === type)[0]?.label;
};
const gotoProfile=(userName)=>{
router.push(`/profile/${userName}`);
}
</script>
<style scoped lang="scss">