@lambo-design/pro-layout 1.0.0-beta.286 → 1.0.0-beta.288

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.286",
3
+ "version": "1.0.0-beta.288",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -66,6 +66,9 @@ export default {
66
66
  this.layoutSize = data.layoutSize ? data.layoutSize : 'default';
67
67
  this.topMenuNum = data.topMenuNum ? data.topMenuNum : 4;
68
68
  this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
69
+ if (!this.activeName) {
70
+ this.activeName = this.acceptAppId
71
+ }
69
72
  this.initNav(this.navList)
70
73
  }
71
74
  },
@@ -100,21 +103,22 @@ export default {
100
103
  this.selectApp(appId)
101
104
  }
102
105
  },
103
- changeApp(appId, appInfo){
104
- this.activeName = appId
105
- },
106
106
  selectApp(appId) {
107
- this.activeName = appId
108
- let res = this.navList.filter(app => app.appId == appId)
109
- Bus.$emit('change-app', { appId, appInfo: res[0] })
107
+ if (appId) {
108
+ this.activeName = appId
109
+ let res = this.navList.filter(app => app.appId == appId)
110
+ Bus.$emit('change-app', { appId, appInfo: res[0] })
111
+ }
110
112
  },
113
+ changeApp(appId, appInfo){
114
+ if (appId) {
115
+ this.activeName = appId
116
+ }
117
+ }
111
118
  },
112
119
  watch: {
113
120
  acceptInt(val){
114
121
  this.pointer = val;
115
- },
116
- acceptAppId(val) {
117
- this.selectApp(val)
118
122
  }
119
123
  },
120
124
  created() {
@@ -22,7 +22,7 @@ import Bus from '@lambo-design/shared/utils/bus'
22
22
  import { deepCopy } from '@lambo-design/shared/utils/assist'
23
23
 
24
24
  export default {
25
- name: 'pro-layout-',
25
+ name: 'pro-layout-nav',
26
26
  props: {
27
27
 
28
28
  },
@@ -64,6 +64,9 @@ export default {
64
64
  if (data) {
65
65
  this.topMenuNum = data.topMenu ? data.topMenu : 4;
66
66
  this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
67
+ if (!this.activeName) {
68
+ this.activeName = this.acceptAppId;
69
+ }
67
70
  this.initNav(this.navList)
68
71
  }
69
72
  },
@@ -98,15 +101,20 @@ export default {
98
101
  this.originMenuList = deepCopy(data)
99
102
  },
100
103
  selectApp(appId) {
101
- this.activeName = appId
102
- let res = this.navList.filter(app => app.appId == appId)
103
- Bus.$emit('change-app', { appId, appInfo: res[0] })
104
+ if (appId) {
105
+ let res = this.navList.filter(app => app.appId == appId)
106
+ if (res && res.length > 0) {
107
+ Bus.$emit('change-app', { appId, appInfo: res[0] })
108
+ }
109
+ }
104
110
  },
105
111
  changeApp(appId, appInfo) {
106
- this.activeName = appId
107
- this.$nextTick(() => {
108
- this.$refs.topNav.updateActiveName()
109
- })
112
+ if (appId) {
113
+ this.activeName = appId
114
+ this.$nextTick(() => {
115
+ this.$refs.topNav.updateActiveName()
116
+ })
117
+ }
110
118
  }
111
119
  },
112
120
  watch: {
@@ -114,11 +122,6 @@ export default {
114
122
  this.$nextTick(() => {
115
123
  this.$refs.topNav.updateActiveName()
116
124
  })
117
- },
118
- acceptAppId(val) {
119
- if (val) {
120
- this.selectApp(val)
121
- }
122
125
  }
123
126
  },
124
127
  created() {
@@ -204,8 +204,6 @@ export default {
204
204
  this.emitTags(res, value);
205
205
  },
206
206
  handleClick(item) {
207
- this.value = item.name
208
- Bus.$emit('menu-click', item.name , item)
209
207
  if (item.meta && item.meta.appId
210
208
  && item.meta.appId != this.appId
211
209
  && item.meta.appId != config.homeRouter.meta.appId) {
@@ -216,6 +214,8 @@ export default {
216
214
  Bus.$emit('change-app', {appId:item.meta.appId,appInfo:null})
217
215
  }
218
216
  }
217
+ this.value = item.name
218
+ Bus.$emit('menu-click', item.name , item);
219
219
  },
220
220
  showTitleInside(item) {
221
221
  return showTitle(item, this)