@jx3box/jx3box-common-ui 5.5.10 → 5.5.11

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/header/nav.vue +12 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "5.5.10",
3
+ "version": "5.5.11",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -55,31 +55,36 @@ export default {
55
55
  props: [],
56
56
  data: function () {
57
57
  return {
58
- nav: default_nav,
59
- client: location.href.includes("origin") ? "origin" : "std",
58
+ nav: default_nav
60
59
  };
61
60
  },
62
61
  computed: {
63
62
  finalNav: function ({ nav }) {
64
-
63
+ // 父节点
65
64
  const finalNav = nav.filter((d) => !d.parentKey);
66
-
65
+ // 子节点
67
66
  const navChildren = nav.filter((c) => c.parentKey);
68
67
 
69
68
  navChildren.forEach((child) => {
70
69
  const parentKey = child.parentKey;
71
-
72
- const parent = finalNav.find((n) => n.key === parentKey);
70
+ // 匹配客户端
71
+ const parent = finalNav.find((n) => n.key === parentKey && this.client === n.client);
73
72
 
74
73
  if (parent) {
75
74
  if (!parent.children) {
76
75
  parent.children = [];
77
76
  }
78
- parent.children.push(child);
77
+ // 区分客户端
78
+ if (child.client === this.client) {
79
+ parent.children.push(child);
80
+ }
79
81
  }
80
82
  });
81
83
 
82
84
  return finalNav
85
+ },
86
+ client() {
87
+ return location.href.includes("origin") ? "origin" : "std"
83
88
  }
84
89
  },
85
90
  methods: {