@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.
- package/package.json +1 -1
- package/src/header/nav.vue +22 -1
package/package.json
CHANGED
package/src/header/nav.vue
CHANGED
|
@@ -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
|
-
|
|
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;
|