@jx3box/jx3box-common-ui 7.8.9 → 7.9.0

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 +22 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "7.8.9",
3
+ "version": "7.9.0",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -130,6 +130,19 @@
130
130
  import default_nav from "../../assets/data/nav.json";
131
131
  import { getMenu } from "../../service/header";
132
132
  import { trimSlash } from "../../assets/js/utils";
133
+
134
+ const activeNav = {
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
+ }
145
+
133
146
  export default {
134
147
  props: [],
135
148
  data: function () {
@@ -170,7 +183,15 @@ export default {
170
183
  },
171
184
  methods: {
172
185
  isFocus: function (type) {
173
- return location.pathname.includes(type);
186
+ let active = '';
187
+ const pathname = location.pathname?.split('/')?.filter(Boolean)?.[0] || '';
188
+ for (const key in activeNav) {
189
+ if (activeNav[key].includes(pathname)) {
190
+ active = key;
191
+ break;
192
+ }
193
+ }
194
+ return type.includes(active);
174
195
  },
175
196
  matchedClient: function (client) {
176
197
  return client == "all" ? true : client == this.client;