@lambo-design/pro-layout 1.0.0-beta.461 → 1.0.0-beta.463

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/pro-layout",
3
- "version": "1.0.0-beta.461",
3
+ "version": "1.0.0-beta.463",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -10,8 +10,8 @@
10
10
  "registry": "https://registry.npmjs.org/"
11
11
  },
12
12
  "devDependencies": {
13
- "@lambo-design/core": "^4.7.1-beta.182",
14
- "@lambo-design/shared": "^1.0.0-beta.367"
13
+ "@lambo-design/shared": "^1.0.0-beta.367",
14
+ "@lambo-design/core": "^4.7.1-beta.182"
15
15
  },
16
16
  "scripts": {
17
17
  "release-pro-layout": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
@@ -2,12 +2,12 @@
2
2
  <div class="pro-layout-header-wrapper">
3
3
  <div class="trigger-box" :style="menuScalingStyle">
4
4
  <slot name="pro-layout-trigger">
5
- <LamboProTrigger v-if="systemInfo.menuScaling === '1'" :menu-scaling-status="systemInfo.menuScalingStatus" :hide-menu-logo="hideMenuLogo"></LamboProTrigger>
5
+ <LamboProTrigger v-if="systemInfo.menuScaling === '1'" :menu-scaling-status="systemInfo.menuScalingStatus" :is-show="!isHome && isShowLeftMenu"></LamboProTrigger>
6
6
  </slot>
7
7
  </div>
8
8
  <div class="logo-box">
9
9
  <slot name="pro-layout-logo">
10
- <LamboProLogo :show-back-to-home="hideMenuLogo"></LamboProLogo>
10
+ <LamboProLogo :is-home="isHome"></LamboProLogo>
11
11
  </slot>
12
12
  </div>
13
13
  <div class="nav-box" v-show="!systemInfo || !systemInfo.navType || systemInfo.navType == 'dropdown'">
@@ -15,7 +15,7 @@
15
15
  <LamboProNav
16
16
  ref="nav"
17
17
  :available-width="availableWidth"
18
- :not-home-index="hideMenuLogo"
18
+ :is-home="isHome"
19
19
  ></LamboProNav>
20
20
  </slot>
21
21
  </div>
@@ -41,7 +41,7 @@
41
41
  <LamboProNavSilde
42
42
  ref="sildeNav"
43
43
  :available-width="availableWidth"
44
- :not-home-index="hideMenuLogo"
44
+ :is-home="isHome"
45
45
  @width-change="handleSlideWidthChange"
46
46
  ></LamboProNavSilde>
47
47
  </div>
@@ -64,7 +64,11 @@ export default {
64
64
  type: String,
65
65
  default:''
66
66
  },
67
- hideMenuLogo: {
67
+ isHome: {
68
+ type: Boolean,
69
+ default:true
70
+ },
71
+ isShowLeftMenu: {
68
72
  type: Boolean,
69
73
  default:true
70
74
  }
@@ -10,7 +10,7 @@
10
10
  <Col>
11
11
  <div class="system-name" :style="nameStyle">{{systemName}}</div>
12
12
  </Col>
13
- <Col v-if="'1' === systemInfo.backToHome && 'button' === systemInfo.backToHomeStyle && showBackToHome">
13
+ <Col v-if="'1' === systemInfo.backToHome && 'button' === systemInfo.backToHomeStyle && !isHome">
14
14
  <Button class="home-btn" shape="circle" icon="ios-home">{{ systemInfo.backToHomeText || '返回工作台' }}</Button>
15
15
  </Col>
16
16
  </Row>
@@ -29,7 +29,7 @@ export default {
29
29
  type: String,
30
30
  default: ''
31
31
  },
32
- showBackToHome: {
32
+ isHome: {
33
33
  type: Boolean,
34
34
  default: true
35
35
  }
@@ -36,7 +36,7 @@ export default {
36
36
  type: Number,
37
37
  default: 800
38
38
  },
39
- notHomeIndex: {
39
+ isHome: {
40
40
  type: Boolean,
41
41
  default: true
42
42
  }
@@ -84,7 +84,7 @@ export default {
84
84
  this.layoutSize = data.layoutSize ? data.layoutSize : 'default';
85
85
  this.topMenuNum = Number.isInteger(data.topMenu) ? data.topMenu : 4;
86
86
  this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
87
- if (!this.activeName && this.notHomeIndex) {
87
+ if (!this.activeName && !this.isHome) {
88
88
  this.activeName = this.acceptAppId
89
89
  }
90
90
  this.initNav(this.navList)
@@ -130,7 +130,7 @@ export default {
130
130
  if (this.activeName) {
131
131
  appId = this.activeName
132
132
  }
133
- if (this.notHomeIndex) {
133
+ if (!this.isHome) {
134
134
  this.selectApp(appId)
135
135
  } else if (this.systemInfo.backToHome === "1" && this.systemInfo.backToHomeStyle === "app") {
136
136
  this.activeName = 'backHome'
@@ -270,7 +270,7 @@ export default {
270
270
  },
271
271
  getIsActive(item) {
272
272
  // 如果不是首页模式,直接比较 appId
273
- if (this.notHomeIndex) {
273
+ if (!this.isHome) {
274
274
  return this.activeName === item.appId;
275
275
  }
276
276
 
@@ -2,7 +2,7 @@
2
2
  <div class="pro-layout-nav-slide-wrapper" ref="slideWrapper">
3
3
  <div class="nav-box-slide" ref="navBox" :style="{ width: availableWidth + 'px' }">
4
4
  <LamboProNavSlideMenu
5
- :not-home-index="notHomeIndex"
5
+ :is-home="isHome"
6
6
  :accept-int="pointer"
7
7
  :available-width="availableWidth"
8
8
  @topMen-list="handleCustomEvent"
@@ -48,7 +48,7 @@ export default {
48
48
  type: Boolean,
49
49
  default: true
50
50
  },
51
- notHomeIndex: {
51
+ isHome: {
52
52
  type: Boolean,
53
53
  default: true
54
54
  }
@@ -72,7 +72,7 @@ export default {
72
72
  type: Number,
73
73
  default: 800
74
74
  },
75
- notHomeIndex: {
75
+ isHome: {
76
76
  type: Boolean,
77
77
  default: true
78
78
  }
@@ -129,7 +129,7 @@ export default {
129
129
  this.systemInfo = data;
130
130
  this.topMenuNum = Number.isInteger(data.topMenu) ? data.topMenu : 4;
131
131
  this.acceptAppId = data.acceptAppId ? data.acceptAppId : "";
132
- if (!this.activeName && this.notHomeIndex) {
132
+ if (!this.activeName && !this.isHome) {
133
133
  this.activeName = this.acceptAppId;
134
134
  }
135
135
  this.initNav(this.navList);
@@ -220,7 +220,7 @@ export default {
220
220
  if (this.activeName) {
221
221
  appId = this.activeName;
222
222
  }
223
- if (this.notHomeIndex) {
223
+ if (!this.isHome) {
224
224
  this.selectApp(appId);
225
225
  } else if (this.systemInfo.backToHome === "1" && this.systemInfo.backToHomeStyle === "app") {
226
226
  this.activeName = 'backHome'
@@ -438,7 +438,7 @@ export default {
438
438
  },
439
439
  getActiveName() {
440
440
  // 如果不是首页模式,直接返回 activeName
441
- if (this.notHomeIndex) {
441
+ if (!this.isHome) {
442
442
  return this.activeName;
443
443
  }
444
444
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <a @click="handleChange" type="text" :class="['sider-trigger-a', collapsed ? 'collapsed' : '']">
3
- <Icon type="md-menu" size="26" v-show="hideMenuLogo" />
3
+ <Icon type="md-menu" size="26" v-show="isShow" />
4
4
  </a>
5
5
  </template>
6
6
 
@@ -9,7 +9,7 @@ import Bus from '@lambo-design/shared/utils/bus'
9
9
  export default {
10
10
  name: "pro-layout-trigger",
11
11
  props:{
12
- hideMenuLogo: {
12
+ isShow: {
13
13
  type: Boolean,
14
14
  default:true
15
15
  },
package/src/index.vue CHANGED
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <i-layout class="pro-layout" :class="layoutClass">
3
3
  <i-header class="pro-layout-header" :style="systemInfo.headBackground ? headBackgroundStyle : ''">
4
- <LamboProLayoutHeader :hide-menu-logo="isHideLeftMenu" ref="header">
4
+ <LamboProLayoutHeader :is-home="isHome" :is-show-left-menu="isShowLeftMenu" ref="header">
5
5
  <template slot = "pro-layout-trigger">
6
6
  <slot name="pro-layout-trigger"></slot>
7
7
  </template>
@@ -24,7 +24,7 @@
24
24
  </i-header>
25
25
  <i-layout>
26
26
  <i-sider
27
- v-show="isHideLeftMenu"
27
+ v-show="isShowLeftMenu"
28
28
  class="pro-layout-sider"
29
29
  hide-trigger
30
30
  collapsible
@@ -34,14 +34,14 @@
34
34
  <LamboProLayoutSider ref="sider"></LamboProLayoutSider>
35
35
  <!-- 拖拽条 -->
36
36
  <div
37
- v-show="isHideLeftMenu"
37
+ v-show="isShowLeftMenu"
38
38
  class="sider-resize-bar"
39
39
  @mousedown.stop.prevent="startResize"
40
40
  ></div>
41
41
  </i-sider>
42
42
  <i-content class="pro-layout-content">
43
43
  <i-layout class="pro-layout-content-layout">
44
- <div class="pro-layout-tabs" v-show="isHideLeftMenu">
44
+ <div class="pro-layout-tabs" v-show="isShowLeftMenu">
45
45
  <LamboProLayoutTabs ref="tabs" :not-single-app="notSingleApp"></LamboProLayoutTabs>
46
46
  </div>
47
47
  <i-content class="pro-layout-page">
@@ -80,9 +80,9 @@ export default {
80
80
  type: Boolean,
81
81
  default: true
82
82
  },
83
- showLeftMenu: {
83
+ isHome: {
84
84
  type: Boolean,
85
- default: false
85
+ default: true
86
86
  },
87
87
  systemInfo: {
88
88
  type: Object,
@@ -143,7 +143,7 @@ export default {
143
143
  appId: '',
144
144
  activeName: '',
145
145
  tagList: [],
146
- isHideLeftMenu: true,
146
+ isShowLeftMenu: true,
147
147
  siderWidth: 220,
148
148
  isResizing: false,
149
149
  minWidth: 180,
@@ -196,14 +196,6 @@ export default {
196
196
  immediate: true,
197
197
  deep: true
198
198
  },
199
- showLeftMenu: {
200
- handler(val) {
201
- if (val === false) {
202
- this.isHideLeftMenu = val;
203
- }
204
- },
205
- immediate: true
206
- },
207
199
  collapsed(val) {
208
200
  if (val) {
209
201
  this.siderWidth = 64
@@ -211,6 +203,14 @@ export default {
211
203
  const savedWidth = localStorage.getItem('siderWidth')
212
204
  this.siderWidth = savedWidth ? parseInt(savedWidth) : 220
213
205
  }
206
+ },
207
+ isHome: {
208
+ handler() {
209
+ if (this.isHome) {
210
+ this.isShowLeftMenu = false
211
+ }
212
+ },
213
+ immediate: true
214
214
  }
215
215
  },
216
216
  methods: {
@@ -347,13 +347,11 @@ export default {
347
347
  appConfig=JSON.parse(appInfo.setting)
348
348
  }
349
349
 
350
- // 优先使用 appConfig,其次使用传入的 showLeftMenu prop,最后使用默认值
350
+ // 优先使用 appConfig最后使用默认值
351
351
  if (appConfig && appConfig.hasOwnProperty("is_hide_left_menu")){
352
- this.isHideLeftMenu = appConfig.is_hide_left_menu != '1'
353
- } else if (this.showLeftMenu !== null) {
354
- this.isHideLeftMenu = this.showLeftMenu;
355
- } else{
356
- this.isHideLeftMenu = true
352
+ this.isShowLeftMenu = appConfig.is_hide_left_menu != '1'
353
+ } else {
354
+ this.isShowLeftMenu = true
357
355
  }
358
356
 
359
357
  this.appId = appId;