Skip to content

Commit

Permalink
feat(default layout): run filterMenu for submenus as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kovansky committed Oct 4, 2023
1 parent 5a4b329 commit c35df69
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
22 changes: 21 additions & 1 deletion packages/app/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,27 @@ export default {
methods: {
filterMenu(menuLinks){
const parser = new UrlParser(this.$store);
return menuLinks.map((item)=> 'to' in item? {...item, to: parser.parse(item.to)}: item);
return menuLinks.map((item)=> {
let newItem = item
if ('to' in newItem) {
newItem = {
...item,
to: parser.parse(item.to)
}
} else {
newItem = item
}
if('submenu' in newItem) {
newItem.submenu = this.filterMenu(newItem.submenu)
}
if('mega_menu' in newItem) {
newItem.mega_menu = this.filterMenu(newItem.mega_menu)
}
return newItem
});
},
closeCookies () {
this.cookies = false
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@nuxtjs/google-analytics": "^2.4.0",
"@nuxtjs/pwa": "^3.3.5",
"@nuxtjs/sentry": "^5.0.3",
"@zhp-pl/ui": "^0.3.0",
"@zhp-pl/ui": "^0.3.1",
"body-scroll-lock": "^3.1.5",
"lodash.debounce": "^4.0.8",
"nuxt": "^2.15.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zhp-pl/ui",
"version": "0.3.0",
"version": "0.3.1",
"scripts": {
"create-index": "node scripts/create-index-file.js",
"version": "yarn create-index",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/atoms/ZButton/ZButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
const { hack, tagComputed } = this;
switch (tagComputed) {
case 'a':
return { href: hack, target: '__blank' };
return { href: hack, target: '_blank' };
case 'router-link':
case 'nuxt-link':
return { to: hack };
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Git LFS file not shown

0 comments on commit c35df69

Please sign in to comment.