diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md
index acdc3d939..cf054cf98 100644
--- a/CHANGELOG.zh_CN.md
+++ b/CHANGELOG.zh_CN.md
@@ -1,3 +1,9 @@
+## Wip
+
+### 🐛 Bug Fixes
+
+- 修复菜单在 hmr 时数据被置空
+
## 2.0.0-rc.18 (2021-02-05)
### ✨ Features
diff --git a/package.json b/package.json
index 2bcc0e813..a0a1c48e2 100644
--- a/package.json
+++ b/package.json
@@ -96,11 +96,11 @@
"vite": "2.0.0-beta.64",
"vite-plugin-html": "^2.0.0",
"vite-plugin-imagemin": "^0.2.2",
- "vite-plugin-mock": "^2.0.1",
+ "vite-plugin-mock": "2.0.5",
"vite-plugin-purge-icons": "^0.6.0",
- "vite-plugin-pwa": "^0.4.2",
- "vite-plugin-style-import": "^0.5.5",
- "vite-plugin-theme": "0.3.3",
+ "vite-plugin-pwa": "^0.4.3",
+ "vite-plugin-style-import": "^0.6.6",
+ "vite-plugin-theme": "0.3.8",
"vue-eslint-parser": "^7.4.1",
"yargs": "^16.2.0"
},
diff --git a/src/components/Form/src/components/FormItem.tsx b/src/components/Form/src/components/FormItem.tsx
index 07a0e6539..8a949dd29 100644
--- a/src/components/Form/src/components/FormItem.tsx
+++ b/src/components/Form/src/components/FormItem.tsx
@@ -321,7 +321,7 @@ export default defineComponent({
return (
isIfShow && (
-
+
{getContent()}
)
diff --git a/src/components/Menu/src/BasicMenu.vue b/src/components/Menu/src/BasicMenu.vue
index 0d4292247..302b79e2b 100644
--- a/src/components/Menu/src/BasicMenu.vue
+++ b/src/components/Menu/src/BasicMenu.vue
@@ -122,6 +122,9 @@
watch(
() => props.items,
() => {
+ if (import.meta.hot && props.items.length === 0) {
+ return;
+ }
handleMenuChange();
}
);
diff --git a/src/design/global.less b/src/design/global.less
index 323ff114c..bc3bc2cb5 100644
--- a/src/design/global.less
+++ b/src/design/global.less
@@ -1,10 +1,6 @@
@import './helper/distance.less';
.distance();
-.hidden {
- display: none !important;
-}
-
.flex {
display: flex;
}
diff --git a/src/design/index.less b/src/design/index.less
index 35947da4d..c06f9d095 100644
--- a/src/design/index.less
+++ b/src/design/index.less
@@ -13,6 +13,11 @@
box-sizing: border-box;
}
+:root {
+ -moz-tab-size: 4;
+ tab-size: 4;
+}
+
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0 1000px white inset !important;
}
@@ -33,6 +38,8 @@ html,
html {
overflow: hidden;
+ line-height: 1.15;
+ -webkit-text-size-adjust: 100%;
}
html,
@@ -53,34 +60,9 @@ body {
}
body {
- 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';
- font-style: normal;
- font-weight: normal;
- line-height: 1.428571429; // 20/14
- letter-spacing: normal;
- word-spacing: normal;
- text-align: left; // Fallback for where `start` is not supported
- text-align: start;
- text-decoration: none;
- text-size-adjust: 100%;
- text-shadow: none;
- text-transform: none;
- word-break: normal;
- word-wrap: normal;
- white-space: normal;
- line-break: auto;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
- margin-top: 0;
- margin-bottom: 0.5em;
- font-weight: 500;
- color: @heading-color;
+ font-family: system-ui, -apple-system, 'Segoe UI', Microsoft YaHei, Arial, sans-serif,
+ Helvetica Neue, Helvetica, Pingfang SC, Hiragino Sans GB, Roboto, helvetica neue, noto sans,
+ apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji;
}
ul,
@@ -92,68 +74,121 @@ li {
list-style-type: none;
}
-img {
- vertical-align: top;
- border: 0;
-}
-
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-
a:focus,
a:active {
outline: none;
}
-i,
-em {
- font-style: normal;
+hr {
+ height: 0;
+ color: inherit;
+}
+
+abbr[title] {
+ text-decoration: underline dotted;
+}
+
+b,
+strong {
+ font-weight: bolder;
+}
+
+code,
+kbd,
+samp,
+pre {
+ font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
+ font-size: 1em;
+}
+
+small {
+ font-size: 80%;
+}
+
+sub,
+sup {
+ position: relative;
+ font-size: 75%;
+ line-height: 0;
+ vertical-align: baseline;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+sup {
+ top: -0.5em;
+}
+
+table {
+ text-indent: 0;
+ border-color: inherit;
}
button,
-div:focus {
- outline: none !important;
+input,
+optgroup,
+select,
+textarea {
+ margin: 0;
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
}
-a {
- color: @link-color;
- text-decoration: none;
- cursor: pointer;
- background-color: transparent; // remove the gray background on active links in IE 10.
- outline: none;
- transition: color 0.3s;
- -webkit-text-decoration-skip: objects; // remove gaps in links underline in iOS 8+ and Safari 8+.
-
- &:hover {
- color: @link-hover-color;
- }
-
- &:active {
- color: @link-active-color;
- }
-
- &:active,
- &:hover {
- text-decoration: none;
- outline: 0;
- }
-
- &[disabled] {
- color: @disabled-color;
- pointer-events: none;
- cursor: not-allowed;
- }
+button,
+select {
+ text-transform: none;
}
-img,
-svg,
-video,
-canvas,
-audio,
-iframe,
-embed,
-object {
- vertical-align: baseline !important;
+button,
+[type='button'],
+[type='reset'],
+[type='submit'] {
+ -webkit-appearance: button;
+}
+
+::-moz-focus-inner {
+ padding: 0;
+ border-style: none;
+}
+
+:-moz-focusring {
+ outline: 1px dotted ButtonText;
+}
+
+:-moz-ui-invalid {
+ box-shadow: none;
+}
+
+legend {
+ padding: 0;
+}
+
+progress {
+ vertical-align: baseline;
+}
+
+::-webkit-inner-spin-button,
+::-webkit-outer-spin-button {
+ height: auto;
+}
+
+[type='search'] {
+ outline-offset: -2px;
+ -webkit-appearance: textfield;
+}
+
+::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+::-webkit-file-upload-button {
+ font: inherit;
+ -webkit-appearance: button;
+}
+
+summary {
+ display: list-item;
}
diff --git a/src/layouts/default/sider/LayoutSider.vue b/src/layouts/default/sider/LayoutSider.vue
index 7dc0f6039..d6a9abd1e 100644
--- a/src/layouts/default/sider/LayoutSider.vue
+++ b/src/layouts/default/sider/LayoutSider.vue
@@ -2,9 +2,10 @@