Skip to content

Commit e4e8837

Browse files
committed
refactor: new page-loading, fix dropdown
1 parent 9bd5709 commit e4e8837

File tree

12 files changed

+74
-59
lines changed

12 files changed

+74
-59
lines changed

public/index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
77
<link rel="icon" href="<%= BASE_URL %>logo.png">
88
<title>Ant Design Pro</title>
9-
<style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
9+
<style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
1010
<!-- require cdn assets css -->
1111
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
1212
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
@@ -17,11 +17,13 @@
1717
<strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
1818
</noscript>
1919
<div id="app">
20-
<div id="loading-mask">
21-
<div class="loading-wrapper">
22-
<span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span>
23-
</div>
20+
<div class="first-loading-wrp">
21+
<h1>Pro</h1>
22+
<div class="loading-wrp">
23+
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
2424
</div>
25+
<div style="display: flex; justify-content: center; align-items: center;">Ant Design</div>
26+
</div>
2527
</div>
2628
<!-- require cdn assets js -->
2729
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>

public/loading/loading.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/loading/loading.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/loading/option2/html_code_segment.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

public/loading/option2/loading.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/loading/option2/loading.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/GlobalHeader/AvatarDropdown.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default {
6666
</script>
6767

6868
<style lang="less" scoped>
69-
.menu {
69+
.ant-pro-drop-down {
7070
/deep/ .action {
7171
margin-right: 8px;
7272
}

src/components/GlobalHeader/RightContent.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div :class="wrpCls">
3-
<avatar-dropdown :menu="showMenu" :current-user="currentUser" class="ant-pro-global-header-index-action" />
4-
<select-lang class="ant-pro-global-header-index-action" />
3+
<avatar-dropdown :menu="showMenu" :current-user="currentUser" :class="actionClassName" />
4+
<select-lang :class="actionClassName" />
55
</div>
66
</template>
77

@@ -22,6 +22,7 @@ export default {
2222
}
2323
},
2424
data () {
25+
this.actionClassName = 'ant-pro-global-header-index-action'
2526
return {
2627
showMenu: true,
2728
currentUser: {}
@@ -41,7 +42,3 @@ export default {
4142
}
4243
}
4344
</script>
44-
45-
<style scoped>
46-
47-
</style>

src/components/SelectLang/index.jsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import './index.less'
2+
13
import { Icon, Menu, Dropdown } from 'ant-design-vue'
24
import { i18nRender } from '@/locales'
3-
import './index.less'
45
import i18nMixin from '@/store/i18n-mixin'
56

67
const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR']
@@ -19,14 +20,21 @@ const languageIcons = {
1920
}
2021

2122
const SelectLang = {
23+
props: {
24+
prefixCls: {
25+
type: String,
26+
default: 'ant-pro-drop-down'
27+
}
28+
},
2229
name: 'SelectLang',
2330
mixins: [i18nMixin],
2431
render () {
32+
const { prefixCls } = this
2533
const changeLang = ({ key }) => {
2634
this.setLang(key)
2735
}
2836
const langMenu = (
29-
<Menu class={['menu', 'drop-down']} selectedKeys={[this.currentLang]} onClick={changeLang}>
37+
<Menu class={['menu', 'ant-pro-header-menu']} selectedKeys={[this.currentLang]} onClick={changeLang}>
3038
{locales.map(locale => (
3139
<Menu.Item key={locale}>
3240
<span role="img" aria-label={languageLabels[locale]}>
@@ -39,7 +47,7 @@ const SelectLang = {
3947
)
4048
return (
4149
<Dropdown overlay={langMenu} placement="bottomRight">
42-
<span class={'.ant-pro-drop-down-lang'}>
50+
<span class={prefixCls}>
4351
<Icon type="global" title={i18nRender('navBar.lang')} />
4452
</span>
4553
</Dropdown>

src/components/SelectLang/index.less

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
@import "~ant-design-vue/es/style/themes/default";
22

33
@header-menu-prefix-cls: ~'@{ant-prefix}-pro-header-menu';
4+
@header-drop-down-prefix-cls: ~'@{ant-prefix}-pro-drop-down';
5+
6+
.@{header-menu-prefix-cls} {
7+
8+
.anticon {
9+
margin-right: 8px;
10+
}
11+
.ant-dropdown-menu-item {
12+
min-width: 160px;
13+
}
14+
}
15+
16+
.@{header-drop-down-prefix-cls} {
417

5-
.ant-pro-drop-down-lang {
618
line-height: @layout-header-height;
719
vertical-align: top;
820
cursor: pointer;
21+
922
> i {
1023
font-size: 16px !important;
1124
transform: none !important;
25+
1226
svg {
1327
position: relative;
1428
top: -1px;
1529
}
1630
}
17-
18-
&.select-lang {
19-
.ant-dropdown-menu-item {
20-
min-width: 120px;
21-
}
22-
}
2331
}

0 commit comments

Comments
 (0)