Commit 9f8796ee586a5f33e20713f53d2aa447b6aa312e
Committed by
GitHub
1 parent
7a000366
fix: update account page demo (#92)
Showing
8 changed files
with
51 additions
and
22 deletions
src/assets/images/demo.png
src/views/demo/page/account/center/Application.vue
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | </template> |
30 | 30 | <script lang="ts"> |
31 | 31 | import { defineComponent } from 'vue'; |
32 | - import { List, Card, Row, Col } from 'ant-design-vue'; | |
32 | + import { List, Card } from 'ant-design-vue'; | |
33 | 33 | import Icon from '/@/components/Icon/index'; |
34 | 34 | import { applicationList } from './data'; |
35 | 35 | |
... | ... | @@ -38,8 +38,6 @@ |
38 | 38 | List, |
39 | 39 | ListItem: List.Item, |
40 | 40 | Card, |
41 | - Row, | |
42 | - Col, | |
43 | 41 | Icon, |
44 | 42 | }, |
45 | 43 | setup() { | ... | ... |
src/views/demo/page/account/center/Article.vue
src/views/demo/page/account/center/Project.vue
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | </template> |
20 | 20 | <script lang="ts"> |
21 | 21 | import { defineComponent } from 'vue'; |
22 | - import { List, Card, Row, Col } from 'ant-design-vue'; | |
22 | + import { List, Card } from 'ant-design-vue'; | |
23 | 23 | import demoImg from '/@/assets/images/demo.png'; |
24 | 24 | import { projectList } from './data'; |
25 | 25 | |
... | ... | @@ -28,8 +28,6 @@ |
28 | 28 | List, |
29 | 29 | ListItem: List.Item, |
30 | 30 | Card, |
31 | - Row, | |
32 | - Col, | |
33 | 31 | }, |
34 | 32 | setup() { |
35 | 33 | return { |
... | ... | @@ -51,6 +49,7 @@ |
51 | 49 | |
52 | 50 | img { |
53 | 51 | width: 100%; |
52 | + height: 130px; | |
54 | 53 | } |
55 | 54 | |
56 | 55 | &-title { | ... | ... |
src/views/demo/page/account/center/data.tsx
... | ... | @@ -42,14 +42,14 @@ export const teams: ListItem[] = [ |
42 | 42 | color: '#00adf7', |
43 | 43 | }, |
44 | 44 | { |
45 | - icon: 'ant-design:dribbble-circle-filled', | |
45 | + icon: 'ant-design:behance-square-filled', | |
46 | 46 | title: '科学搬砖组', |
47 | - color: '#ff4000', | |
47 | + color: '#7c51b8', | |
48 | 48 | }, |
49 | 49 | { |
50 | - icon: 'ant-design:behance-square-filled', | |
50 | + icon: 'ant-design:dribbble-circle-filled', | |
51 | 51 | title: '程序员日常', |
52 | - color: '#7c51b8', | |
52 | + color: '#ff4000', | |
53 | 53 | }, |
54 | 54 | ]; |
55 | 55 | |
... | ... | @@ -124,8 +124,8 @@ export const projectList = (() => { |
124 | 124 | const result: any[] = []; |
125 | 125 | for (let i = 0; i < 8; i++) { |
126 | 126 | result.push({ |
127 | - title: 'Angular', | |
128 | - content: '那是一种内在的东西, 他们到达不了,', | |
127 | + title: 'Vben Admin', | |
128 | + content: '基于Vue Next, TypeScript, Ant Design实现的一套完整的企业级后台管理系统。', | |
129 | 129 | }); |
130 | 130 | } |
131 | 131 | return result; | ... | ... |
src/views/demo/page/account/center/index.vue
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | </template> |
52 | 52 | |
53 | 53 | <script lang="ts"> |
54 | - import { Row, Col, Tag, Tabs } from 'ant-design-vue'; | |
54 | + import { Tag, Tabs } from 'ant-design-vue'; | |
55 | 55 | import { defineComponent } from 'vue'; |
56 | 56 | import { CollapseContainer } from '/@/components/Container/index'; |
57 | 57 | import Icon from '/@/components/Icon/index'; |
... | ... | @@ -66,8 +66,6 @@ |
66 | 66 | components: { |
67 | 67 | CollapseContainer, |
68 | 68 | Icon, |
69 | - Row, | |
70 | - Col, | |
71 | 69 | Tag, |
72 | 70 | Tabs, |
73 | 71 | TabPane: Tabs.TabPane, |
... | ... | @@ -130,7 +128,7 @@ |
130 | 128 | &__team { |
131 | 129 | &-item { |
132 | 130 | display: inline-block; |
133 | - padding: 4px 18px; | |
131 | + padding: 4px 24px; | |
134 | 132 | } |
135 | 133 | |
136 | 134 | span { | ... | ... |
src/views/demo/page/account/setting/BaseSetting.vue
1 | 1 | <template> |
2 | 2 | <CollapseContainer title="基本设置" :canExpan="false"> |
3 | - <BasicForm @register="register" /> | |
3 | + <a-row :gutter="24"> | |
4 | + <a-col :span="14"> | |
5 | + <BasicForm @register="register" /> | |
6 | + </a-col> | |
7 | + <a-col :span="10"> | |
8 | + <div class="change-avatar"> | |
9 | + <div class="mb-2">头像</div> | |
10 | + <img width="140" :src="headerImg" /> | |
11 | + <Upload :showUploadList="false"> | |
12 | + <Button type="ghost" class="ml-5"> | |
13 | + <Icon icon="ant-design:upload-outlined" />更换头像 | |
14 | + </Button> | |
15 | + </Upload> | |
16 | + </div> | |
17 | + </a-col> | |
18 | + </a-row> | |
4 | 19 | <Button type="primary" @click="handleSubmit">更新基本信息</Button> |
5 | 20 | </CollapseContainer> |
6 | 21 | </template> |
7 | 22 | <script lang="ts"> |
8 | - import { Button } from 'ant-design-vue'; | |
23 | + import { Button, Upload } from 'ant-design-vue'; | |
9 | 24 | import { defineComponent, onMounted } from 'vue'; |
10 | 25 | import { BasicForm, useForm } from '/@/components/Form/index'; |
11 | 26 | import { CollapseContainer } from '/@/components/Container/index'; |
27 | + import Icon from '/@/components/Icon/index'; | |
12 | 28 | |
13 | 29 | import { useMessage } from '/@/hooks/web/useMessage'; |
14 | 30 | |
31 | + import headerImg from '/@/assets/images/header.jpg'; | |
15 | 32 | import { accountInfoApi } from '/@/api/demo/account'; |
16 | 33 | import { baseSetschemas } from './data'; |
17 | 34 | |
18 | 35 | export default defineComponent({ |
19 | - components: { BasicForm, CollapseContainer, Button }, | |
36 | + components: { BasicForm, CollapseContainer, Button, Upload, Icon }, | |
20 | 37 | setup() { |
21 | 38 | const { createMessage } = useMessage(); |
22 | 39 | |
... | ... | @@ -32,6 +49,7 @@ |
32 | 49 | }); |
33 | 50 | |
34 | 51 | return { |
52 | + headerImg, | |
35 | 53 | register, |
36 | 54 | handleSubmit: () => { |
37 | 55 | createMessage.success('更新成功!'); |
... | ... | @@ -40,3 +58,13 @@ |
40 | 58 | }, |
41 | 59 | }); |
42 | 60 | </script> |
61 | + | |
62 | +<style lang="less" scoped> | |
63 | + .change-avatar { | |
64 | + img { | |
65 | + display: block; | |
66 | + margin-bottom: 15px; | |
67 | + border-radius: 50%; | |
68 | + } | |
69 | + } | |
70 | +</style> | ... | ... |
src/views/demo/page/account/setting/index.vue
1 | 1 | <template> |
2 | 2 | <ScrollContainer> |
3 | 3 | <div ref="wrapperRef" class="m-4 account"> |
4 | - <Tabs tab-position="left"> | |
4 | + <Tabs tab-position="left" :tabBarStyle="tabBarStyle"> | |
5 | 5 | <template v-for="item in settingList" :key="item.key"> |
6 | 6 | <TabPane :tab="item.name"> |
7 | 7 | <component :is="item.component" /> |
... | ... | @@ -35,7 +35,12 @@ |
35 | 35 | MsgNotify, |
36 | 36 | }, |
37 | 37 | setup() { |
38 | - return { settingList }; | |
38 | + return { | |
39 | + settingList, | |
40 | + tabBarStyle: { | |
41 | + width: '220px', | |
42 | + }, | |
43 | + }; | |
39 | 44 | }, |
40 | 45 | }); |
41 | 46 | </script> | ... | ... |