Browse Source

fix: rightContent render #779

liangliangyin 4 years ago
parent
commit
ccfa8ec680
5 changed files with 25 additions and 15 deletions
  1. 2 2
      package.json
  2. 11 4
      src/components/GlobalHeader/RightContent.vue
  3. 1 1
      src/layouts/BasicLayout.vue
  4. 3 0
      src/locales/lang/en-US.js
  5. 8 8
      yarn.lock

+ 2 - 2
package.json

@@ -11,9 +11,9 @@
     "lint:nofix": "vue-cli-service lint --no-fix"
   },
   "dependencies": {
-    "@ant-design-vue/pro-layout": "^0.2.9",
+    "@ant-design-vue/pro-layout": "^0.2.10",
     "@antv/data-set": "^0.10.2",
-    "ant-design-vue": "1.5.5",
+    "ant-design-vue": "1.6.0",
     "axios": "^0.19.0",
     "core-js": "^3.1.2",
     "enquire.js": "^2.1.6",

+ 11 - 4
src/components/GlobalHeader/RightContent.vue

@@ -1,7 +1,7 @@
 <template>
   <div :class="wrpCls">
-    <avatar-dropdown :menu="showMenu" :current-user="currentUser" :class="actionClassName" />
-    <select-lang :class="actionClassName" />
+    <avatar-dropdown :menu="showMenu" :current-user="currentUser" :class="prefixCls" />
+    <select-lang :class="prefixCls" />
   </div>
 </template>
 
@@ -16,6 +16,14 @@ export default {
     SelectLang
   },
   props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-global-header-index-action'
+    },
+    isMobile: {
+      type: Boolean,
+      default: () => false
+    },
     topMenu: {
       type: Boolean,
       required: true
@@ -26,7 +34,6 @@ export default {
     }
   },
   data () {
-    this.actionClassName = 'ant-pro-global-header-index-action'
     return {
       showMenu: true,
       currentUser: {}
@@ -36,7 +43,7 @@ export default {
     wrpCls () {
       return {
         'ant-pro-global-header-index-right': true,
-        [`ant-pro-global-header-index-${this.topMenu && this.theme || 'light'}`]: true
+        [`ant-pro-global-header-index-${(this.topMenu && this.isMobile) && this.theme || 'light'}`]: true
       }
     }
   },

+ 1 - 1
src/layouts/BasicLayout.vue

@@ -108,7 +108,7 @@ export default {
         this.isMobile = true
         this.collapsed = false
         this.settings.contentWidth = false
-        this.settings.fixSiderbar = false
+        // this.settings.fixSiderbar = false
       }
     },
     handleCollapse (val) {

+ 3 - 0
src/locales/lang/en-US.js

@@ -15,6 +15,9 @@ const locale = {
   'menu.dashboard.monitor': 'Monitor',
   'menu.dashboard.workplace': 'Workplace',
 
+  'layouts.usermenu.dialog.title': 'Message',
+  'layouts.usermenu.dialog.content': 'Do you really log-out.',
+
   'app.setting.pagestyle': 'Page style setting',
   'app.setting.pagestyle.light': 'Light style',
   'app.setting.pagestyle.dark': 'Dark style',

+ 8 - 8
yarn.lock

@@ -2,10 +2,10 @@
 # yarn lockfile v1
 
 
-"@ant-design-vue/pro-layout@^0.2.9":
-  version "0.2.9"
-  resolved "https://registry.npm.taobao.org/@ant-design-vue/pro-layout/download/@ant-design-vue/pro-layout-0.2.9.tgz?cache=0&sync_timestamp=1589537984599&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40ant-design-vue%2Fpro-layout%2Fdownload%2F%40ant-design-vue%2Fpro-layout-0.2.9.tgz#eb6d439322fe50ff0add454bf24eab6342f92e75"
-  integrity sha1-621DkyL+UP8K3UVL8k6rY0L5LnU=
+"@ant-design-vue/pro-layout@^0.2.10":
+  version "0.2.10"
+  resolved "https://registry.npm.taobao.org/@ant-design-vue/pro-layout/download/@ant-design-vue/pro-layout-0.2.10.tgz#f27c958480997d7cc780c051e887bd33008d97fa"
+  integrity sha1-8nyVhICZfXzHgMBR6Ie9MwCNl/o=
   dependencies:
     ant-design-vue "^1.5.3"
     classnames "^2.2.6"
@@ -1981,10 +1981,10 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
     "@types/color-name" "^1.1.1"
     color-convert "^2.0.1"
 
-ant-design-vue@1.5.5:
-  version "1.5.5"
-  resolved "https://registry.npm.taobao.org/ant-design-vue/download/ant-design-vue-1.5.5.tgz#11e5fabedfb6f51ccedb3f7b1650d5f388157eb3"
-  integrity sha1-EeX6vt+29RzO2z97FlDV84gVfrM=
+ant-design-vue@1.6.0:
+  version "1.6.0"
+  resolved "https://registry.npm.taobao.org/ant-design-vue/download/ant-design-vue-1.6.0.tgz?cache=0&sync_timestamp=1589552419910&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fant-design-vue%2Fdownload%2Fant-design-vue-1.6.0.tgz#673e09e3ac56feb14154a711e52357fb7518cc32"
+  integrity sha1-Zz4J46xW/rFBVKcR5SNX+3UYzDI=
   dependencies:
     "@ant-design/icons" "^2.1.1"
     "@ant-design/icons-vue" "^2.0.0"