leisure-core 0.6.2 → 0.6.4
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/le-home/src/main.vue +16 -12
- package/package.json +1 -1
package/le-home/src/main.vue
CHANGED
|
@@ -256,9 +256,23 @@ export default {
|
|
|
256
256
|
];
|
|
257
257
|
|
|
258
258
|
this.$store.commit("setDict", dict);
|
|
259
|
-
// const menus = JSON.parse(JSON.stringify(this.$store.getters.menu));
|
|
260
259
|
|
|
261
|
-
|
|
260
|
+
const menus = JSON.parse(JSON.stringify(this.$store.getters.menu));
|
|
261
|
+
const vm = this; // 保存组件实例引用
|
|
262
|
+
this.menuData = menus.filter(function (item) {
|
|
263
|
+
if (item.children) {
|
|
264
|
+
// 确保子菜单数组的响应性
|
|
265
|
+
const filteredChildren = item.children.filter(
|
|
266
|
+
(item1) => item1.ishide === 0
|
|
267
|
+
);
|
|
268
|
+
vm.$set(item, "children", filteredChildren);
|
|
269
|
+
}
|
|
270
|
+
return item;
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
//代码2
|
|
274
|
+
// this.menuData = this.$store.getters.menu;
|
|
275
|
+
// this.menuData = this.$store.getters.menu.filter(function (item) {
|
|
262
276
|
// if (item.children) {
|
|
263
277
|
// item.children = item.children.filter(function (item1) {
|
|
264
278
|
// return item1.ishide === 0;
|
|
@@ -267,16 +281,6 @@ export default {
|
|
|
267
281
|
// return item;
|
|
268
282
|
// });
|
|
269
283
|
|
|
270
|
-
this.menuData = this.$store.getters.menu;
|
|
271
|
-
this.menuData = this.$store.getters.menu.filter(function (item) {
|
|
272
|
-
if (item.children) {
|
|
273
|
-
item.children = item.children.filter(function (item1) {
|
|
274
|
-
return item1.ishide === 0;
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
return item;
|
|
278
|
-
});
|
|
279
|
-
|
|
280
284
|
this.$emit("homeInit");
|
|
281
285
|
document.addEventListener("keydown", this.handleKeyDown);
|
|
282
286
|
},
|