@jx3box/jx3box-vue3-ui 0.8.9 → 0.8.10

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 +14 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-vue3-ui",
3
- "version": "0.8.9",
3
+ "version": "0.8.10",
4
4
  "description": "JX3BOX Vue3 UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -126,21 +126,22 @@
126
126
  </template>
127
127
 
128
128
  <script>
129
+ import { cloneDeep } from "lodash";
129
130
  import default_nav from "../../assets/data/nav.json";
130
131
  import { getMenu } from "../../service/header";
131
132
  import { trimSlash } from "../../utils";
132
133
 
133
134
  const activeNav = {
134
- index: ['index'],
135
- macro: ['macro', 'pz'],
136
- tool: ['app', 'jx3dat', 'dbm'],
137
- bps: ['bps', 'jcl', 'battle'],
138
- fb: ['fb','baizhan','team', 'jdt', 'rank'],
139
- cj: ['cj', 'item', 'knowledge', 'quest'],
140
- pvx: ['face', 'adventure', 'pvg'],
141
- bbs: ['bbs','topic','event'],
142
- pvp: ['pvp']
143
- }
135
+ index: ["index"],
136
+ macro: ["macro", "pz"],
137
+ tool: ["app", "jx3dat", "dbm"],
138
+ bps: ["bps", "jcl", "battle"],
139
+ fb: ["fb", "baizhan", "team", "jdt", "rank"],
140
+ cj: ["cj", "item", "knowledge", "quest"],
141
+ pvx: ["face", "adventure", "pvg"],
142
+ bbs: ["bbs", "topic", "event"],
143
+ pvp: ["pvp"],
144
+ };
144
145
  export default {
145
146
  name: "HeaderNav",
146
147
  props: [],
@@ -153,6 +154,7 @@ export default {
153
154
  },
154
155
  computed: {
155
156
  finalNav: function ({ nav }) {
157
+ nav = cloneDeep(nav);
156
158
  // 父节点
157
159
  const finalNav = nav.filter((d) => !d.parentKey && d.status);
158
160
  // 子节点
@@ -183,8 +185,8 @@ export default {
183
185
  methods: {
184
186
  isFocus: function (type) {
185
187
  // return location.pathname.includes(type);
186
- let active = '';
187
- const pathname = location.pathname?.split('/')?.filter(Boolean)?.[0] || '';
188
+ let active = "";
189
+ const pathname = location.pathname?.split("/")?.filter(Boolean)?.[0] || "";
188
190
  for (const key in activeNav) {
189
191
  if (activeNav[key].includes(pathname)) {
190
192
  active = key;