-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(theme): appHeader navigation improvement
- add @nuxtjs/device package to recognize used device - remove mobile observer from header and replave it with device recognition tool - navigation is now lazy loaded, categories required for a navigation are not loaded at all on mobile devices
- Loading branch information
1 parent
ac62c4a
commit dda4502
Showing
5 changed files
with
65 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/theme/components/Navigation/HeaderNavigationItem.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<div class="sf-header-navigation-item"> | ||
<div class="sf-header-navigation-item__item sf-header-navigation-item__item--desktop"> | ||
<slot name="desktop-navigation-item"> | ||
<SfLink | ||
class="sf-header-navigation-item__link" | ||
:link="link" | ||
> | ||
{{ | ||
label | ||
}} | ||
</SfLink> | ||
</slot> | ||
<slot /> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
import { SfLink } from '@storefront-ui/vue'; | ||
export default { | ||
name: 'HeaderNavigationItem', | ||
components: { | ||
SfLink, | ||
}, | ||
props: { | ||
label: { | ||
type: String, | ||
default: '', | ||
}, | ||
link: { | ||
type: [String, Object], | ||
default: '', | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters