vue-vben-admin/src/views/demo/page/account/center/index.vue

156 lines
3.8 KiB
Vue
Raw Normal View History

2020-11-15 12:47:59 +08:00
<template>
<div :class="prefixCls">
2020-11-15 13:46:16 +08:00
<a-row :class="`${prefixCls}-top`">
<a-col :span="9" :class="`${prefixCls}-col`">
<a-row>
<a-col :span="8">
2020-11-15 12:47:59 +08:00
<div :class="`${prefixCls}-top__avatar`">
<img width="70" :src="avatar" />
2021-03-31 23:52:11 +08:00
<span>Vben</span>
2020-11-15 12:47:59 +08:00
<div>海纳百川有容乃大</div>
</div>
2020-11-15 13:46:16 +08:00
</a-col>
<a-col :span="16">
2020-11-15 12:47:59 +08:00
<div :class="`${prefixCls}-top__detail`">
2021-06-17 21:43:53 +08:00
<template v-for="detail in details" :key="detail.title">
2020-11-15 12:47:59 +08:00
<p>
<Icon :icon="detail.icon" />
{{ detail.title }}
</p>
</template>
</div>
2020-11-15 13:46:16 +08:00
</a-col>
</a-row>
</a-col>
<a-col :span="7" :class="`${prefixCls}-col`">
2020-11-15 12:47:59 +08:00
<CollapseContainer title="标签" :canExpan="false">
2021-06-17 21:43:53 +08:00
<template v-for="tag in tags" :key="tag">
2021-01-28 23:28:50 +08:00
<Tag class="mb-2">
{{ tag }}
</Tag>
2020-11-15 12:47:59 +08:00
</template>
</CollapseContainer>
2020-11-15 13:46:16 +08:00
</a-col>
<a-col :span="8" :class="`${prefixCls}-col`">
2020-11-15 12:47:59 +08:00
<CollapseContainer :class="`${prefixCls}-top__team`" title="团队" :canExpan="false">
<div v-for="(team, index) in teams" :key="index" :class="`${prefixCls}-top__team-item`">
<Icon :icon="team.icon" :color="team.color" />
<span>{{ team.title }}</span>
</div>
</CollapseContainer>
2020-11-15 13:46:16 +08:00
</a-col>
</a-row>
2020-11-15 12:47:59 +08:00
<div :class="`${prefixCls}-bottom`">
<Tabs>
<template v-for="item in achieveList" :key="item.key">
<TabPane :tab="item.name">
<component :is="item.component" />
</TabPane>
</template>
</Tabs>
</div>
</div>
</template>
<script lang="ts">
2021-01-18 23:37:36 +08:00
import { Tag, Tabs, Row, Col } from 'ant-design-vue';
import { defineComponent, computed } from 'vue';
2020-11-15 12:47:59 +08:00
import { CollapseContainer } from '/@/components/Container/index';
import Icon from '/@/components/Icon/index';
import Article from './Article.vue';
import Application from './Application.vue';
import Project from './Project.vue';
import headerImg from '/@/assets/images/header.jpg';
import { tags, teams, details, achieveList } from './data';
import { useUserStore } from '/@/store/modules/user';
2020-11-15 12:47:59 +08:00
export default defineComponent({
components: {
CollapseContainer,
Icon,
Tag,
Tabs,
TabPane: Tabs.TabPane,
Article,
Application,
Project,
2021-01-18 23:37:36 +08:00
[Row.name]: Row,
[Col.name]: Col,
2020-11-15 12:47:59 +08:00
},
setup() {
const userStore = useUserStore();
const avatar = computed(() => userStore.getUserInfo.avatar || headerImg);
2020-11-15 12:47:59 +08:00
return {
prefixCls: 'account-center',
avatar,
2020-11-15 12:47:59 +08:00
tags,
teams,
details,
achieveList,
};
},
});
</script>
<style lang="less" scoped>
.account-center {
&-col:not(:last-child) {
padding: 0 10px;
&:not(:last-child) {
2021-10-25 23:49:03 +08:00
border-right: 1px dashed rgb(206 206 206 / 50%);
2020-11-15 12:47:59 +08:00
}
}
&-top {
padding: 10px;
2021-10-25 23:49:03 +08:00
margin: 16px 16px 12px;
2021-04-13 21:43:10 +08:00
background-color: @component-background;
2020-11-15 12:47:59 +08:00
border-radius: 3px;
&__avatar {
text-align: center;
img {
margin: auto;
2020-11-15 12:47:59 +08:00
border-radius: 50%;
}
span {
display: block;
font-size: 20px;
font-weight: 500;
}
div {
margin-top: 3px;
font-size: 12px;
}
}
&__detail {
padding-left: 20px;
margin-top: 15px;
}
&__team {
&-item {
display: inline-block;
2020-11-17 22:49:49 +08:00
padding: 4px 24px;
2020-11-15 12:47:59 +08:00
}
span {
margin-left: 3px;
}
}
}
&-bottom {
padding: 10px;
2021-10-25 23:49:03 +08:00
margin: 0 16px 16px;
2021-04-13 21:43:10 +08:00
background-color: @component-background;
2020-11-15 12:47:59 +08:00
border-radius: 3px;
}
}
</style>