@lambo-design/pro-layout 1.0.0-beta.17 → 1.0.0-beta.18

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.17",
3
+ "version": "1.0.0-beta.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -150,15 +150,6 @@ export default {
150
150
  if (menu && menu.name) {
151
151
  if (!tagExists(tagList,menu.name)) {
152
152
  tagList.push(menu);
153
- } else {
154
- let tag = tagList.filter(item => item.name == menu.name)[0];
155
- console.log("tag0=",tag)
156
- if (!routeEqual(tag,menu)) {
157
- let res = tagList.filter(item => item.name !== menu.name);
158
- tag = Object.assign(tag, menu);
159
- console.log("tag1=",tag)
160
- res.push(tag);
161
- }
162
153
  }
163
154
  Bus.$emit('tag-list', tagList, menu.name)
164
155
  }
package/src/index.vue CHANGED
@@ -35,7 +35,7 @@ import LamboProLayoutTabs from './components/pro-layout-tabs'
35
35
  import Bus from '@lambo-design/shared/utils/bus'
36
36
  import config from "@lambo-design/shared/config/config";
37
37
  import {
38
- getTagNavListFromLocalstorage, tagExists,
38
+ getTagNavListFromLocalstorage, routeEqual, tagExists,
39
39
  } from "@lambo-design/shared/utils/platform";
40
40
  import {deepCopy} from "@lambo-design/shared/utils/assist";
41
41
  export default {
@@ -182,6 +182,17 @@ export default {
182
182
  let tagList = getTagNavListFromLocalstorage(config.routerBase + '-tagNavList');
183
183
  if (!tagExists(tagList,name)) {
184
184
  tagList.push(menuItem);
185
+ } else {
186
+ let tag = tagList.filter(item => item.name == name)[0];
187
+ console.log("tag0=",tag)
188
+ console.log("menuItem=",menuItem)
189
+ if (!routeEqual(tag,menuItem)) {
190
+ let res = tagList.filter(item => item.name !== name);
191
+ tag = Object.assign(tag, menu);
192
+ console.log("tag1=",tag)
193
+ res.push(tag);
194
+ tagList = deepCopy(res);
195
+ }
185
196
  }
186
197
  Bus.$emit('tag-list', tagList, name)
187
198
  }