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