Skip to content

Commit aaae668

Browse files
committed
perf: update style
1 parent 562e2af commit aaae668

File tree

9 files changed

+281
-207
lines changed

9 files changed

+281
-207
lines changed

CHANGELOG.zh_CN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Wip
2+
3+
### 🐛 Bug Fixes
4+
5+
- 修复菜单在 hmr 时数据被置空
6+
17
## 2.0.0-rc.18 (2021-02-05)
28

39
### ✨ Features

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@
9696
"vite": "2.0.0-beta.64",
9797
"vite-plugin-html": "^2.0.0",
9898
"vite-plugin-imagemin": "^0.2.2",
99-
"vite-plugin-mock": "^2.0.1",
99+
"vite-plugin-mock": "2.0.5",
100100
"vite-plugin-purge-icons": "^0.6.0",
101-
"vite-plugin-pwa": "^0.4.2",
102-
"vite-plugin-style-import": "^0.5.5",
103-
"vite-plugin-theme": "0.3.3",
101+
"vite-plugin-pwa": "^0.4.3",
102+
"vite-plugin-style-import": "^0.6.6",
103+
"vite-plugin-theme": "0.3.8",
104104
"vue-eslint-parser": "^7.4.1",
105105
"yargs": "^16.2.0"
106106
},

src/components/Form/src/components/FormItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export default defineComponent({
321321

322322
return (
323323
isIfShow && (
324-
<Col {...realColProps} class={{ hidden: !isShow }}>
324+
<Col {...realColProps} v-show={isShow}>
325325
{getContent()}
326326
</Col>
327327
)

src/components/Menu/src/BasicMenu.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@
122122
watch(
123123
() => props.items,
124124
() => {
125+
if (import.meta.hot && props.items.length === 0) {
126+
return;
127+
}
125128
handleMenuChange();
126129
}
127130
);

src/design/global.less

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
@import './helper/distance.less';
22
.distance();
33

4-
.hidden {
5-
display: none !important;
6-
}
7-
84
.flex {
95
display: flex;
106
}

src/design/index.less

Lines changed: 109 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
box-sizing: border-box;
1414
}
1515

16+
:root {
17+
-moz-tab-size: 4;
18+
tab-size: 4;
19+
}
20+
1621
input:-webkit-autofill {
1722
-webkit-box-shadow: 0 0 0 1000px white inset !important;
1823
}
@@ -33,6 +38,8 @@ html,
3338

3439
html {
3540
overflow: hidden;
41+
line-height: 1.15;
42+
-webkit-text-size-adjust: 100%;
3643
}
3744

3845
html,
@@ -53,34 +60,9 @@ body {
5360
}
5461

5562
body {
56-
font-family: 'BlinkMacSystemFont,segoe ui,Microsoft YaHei,Arial,sans-serif,Helvetica Neue,Helvetica,Pingfang SC,Hiragino Sans GB,Roboto,helvetica neue,Arial,noto sans,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji';
57-
font-style: normal;
58-
font-weight: normal;
59-
line-height: 1.428571429; // 20/14
60-
letter-spacing: normal;
61-
word-spacing: normal;
62-
text-align: left; // Fallback for where `start` is not supported
63-
text-align: start;
64-
text-decoration: none;
65-
text-size-adjust: 100%;
66-
text-shadow: none;
67-
text-transform: none;
68-
word-break: normal;
69-
word-wrap: normal;
70-
white-space: normal;
71-
line-break: auto;
72-
}
73-
74-
h1,
75-
h2,
76-
h3,
77-
h4,
78-
h5,
79-
h6 {
80-
margin-top: 0;
81-
margin-bottom: 0.5em;
82-
font-weight: 500;
83-
color: @heading-color;
63+
font-family: system-ui, -apple-system, 'Segoe UI', Microsoft YaHei, Arial, sans-serif,
64+
Helvetica Neue, Helvetica, Pingfang SC, Hiragino Sans GB, Roboto, helvetica neue, noto sans,
65+
apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji;
8466
}
8567

8668
ul,
@@ -92,68 +74,121 @@ li {
9274
list-style-type: none;
9375
}
9476

95-
img {
96-
vertical-align: top;
97-
border: 0;
77+
a:focus,
78+
a:active {
79+
outline: none;
80+
}
81+
82+
hr {
83+
height: 0;
84+
color: inherit;
85+
}
86+
87+
abbr[title] {
88+
text-decoration: underline dotted;
89+
}
90+
91+
b,
92+
strong {
93+
font-weight: bolder;
94+
}
95+
96+
code,
97+
kbd,
98+
samp,
99+
pre {
100+
font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
101+
font-size: 1em;
102+
}
103+
104+
small {
105+
font-size: 80%;
106+
}
107+
108+
sub,
109+
sup {
110+
position: relative;
111+
font-size: 75%;
112+
line-height: 0;
113+
vertical-align: baseline;
114+
}
115+
116+
sub {
117+
bottom: -0.25em;
118+
}
119+
120+
sup {
121+
top: -0.5em;
98122
}
99123

100124
table {
101-
border-collapse: collapse;
102-
border-spacing: 0;
125+
text-indent: 0;
126+
border-color: inherit;
103127
}
104128

105-
a:focus,
106-
a:active {
107-
outline: none;
129+
button,
130+
input,
131+
optgroup,
132+
select,
133+
textarea {
134+
margin: 0;
135+
font-family: inherit;
136+
font-size: 100%;
137+
line-height: 1.15;
108138
}
109139

110-
i,
111-
em {
112-
font-style: normal;
140+
button,
141+
select {
142+
text-transform: none;
113143
}
114144

115145
button,
116-
div:focus {
117-
outline: none !important;
146+
[type='button'],
147+
[type='reset'],
148+
[type='submit'] {
149+
-webkit-appearance: button;
118150
}
119151

120-
a {
121-
color: @link-color;
122-
text-decoration: none;
123-
cursor: pointer;
124-
background-color: transparent; // remove the gray background on active links in IE 10.
125-
outline: none;
126-
transition: color 0.3s;
127-
-webkit-text-decoration-skip: objects; // remove gaps in links underline in iOS 8+ and Safari 8+.
152+
::-moz-focus-inner {
153+
padding: 0;
154+
border-style: none;
155+
}
128156

129-
&:hover {
130-
color: @link-hover-color;
131-
}
157+
:-moz-focusring {
158+
outline: 1px dotted ButtonText;
159+
}
132160

133-
&:active {
134-
color: @link-active-color;
135-
}
161+
:-moz-ui-invalid {
162+
box-shadow: none;
163+
}
136164

137-
&:active,
138-
&:hover {
139-
text-decoration: none;
140-
outline: 0;
141-
}
165+
legend {
166+
padding: 0;
167+
}
142168

143-
&[disabled] {
144-
color: @disabled-color;
145-
pointer-events: none;
146-
cursor: not-allowed;
147-
}
169+
progress {
170+
vertical-align: baseline;
171+
}
172+
173+
::-webkit-inner-spin-button,
174+
::-webkit-outer-spin-button {
175+
height: auto;
176+
}
177+
178+
[type='search'] {
179+
outline-offset: -2px;
180+
-webkit-appearance: textfield;
181+
}
182+
183+
::-webkit-search-decoration {
184+
-webkit-appearance: none;
185+
}
186+
187+
::-webkit-file-upload-button {
188+
font: inherit;
189+
-webkit-appearance: button;
148190
}
149191

150-
img,
151-
svg,
152-
video,
153-
canvas,
154-
audio,
155-
iframe,
156-
embed,
157-
object {
158-
vertical-align: baseline !important;
192+
summary {
193+
display: list-item;
159194
}

src/layouts/default/sider/LayoutSider.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<div
33
v-if="getMenuFixed && !getIsMobile"
44
:style="getHiddenDomStyle"
5-
:class="{ hidden: !showClassSideBarRef }"
5+
v-show="showClassSideBarRef"
66
></div>
77
<Sider
8+
v-show="showClassSideBarRef"
89
ref="sideRef"
910
breakpoint="lg"
1011
collapsible
@@ -84,7 +85,6 @@
8485
prefixCls,
8586
{
8687
[`${prefixCls}--fixed`]: unref(getMenuFixed),
87-
hidden: !unref(showClassSideBarRef),
8888
[`${prefixCls}--mix`]: unref(getIsMixMode) && !unref(getIsMobile),
8989
},
9090
];

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"allowJs": true,
1313
"sourceMap": true,
1414
"esModuleInterop": true,
15+
"resolveJsonModule": true,
1516
"noUnusedLocals": true,
1617
"noUnusedParameters": true,
1718
"experimentalDecorators": true,

0 commit comments

Comments
 (0)