Skip to content

Commit

Permalink
fix(nav): unepxected error when themeConfig.nav isn't given. (close: #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz authored and yyx990803 committed Apr 18, 2018
1 parent 846eb59 commit f052472
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/default-theme/NavLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export default {
components: { OutboundLink, NavLink, DropdownLink },
computed: {
userNav () {
if (Array.isArray(this.$site.themeConfig.nav)) {
return this.$site.themeConfig.nav
}
return this.$site.themeConfig.nav[this.$basepath]
const { nav } = this.$site.themeConfig
if (Array.isArray(nav)) return nav
if (typeof nav === 'object') return nav[this.$basepath]
return []
},
nav () {
if (this.$site.langs && this.$site.langs.length) {
Expand Down

0 comments on commit f052472

Please sign in to comment.