Skip to content

Commit f052472

Browse files
ulivzyyx990803
authored andcommitted
fix(nav): unepxected error when themeConfig.nav isn't given. (close: #125) (#127)
1 parent 846eb59 commit f052472

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/default-theme/NavLinks.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export default {
3030
components: { OutboundLink, NavLink, DropdownLink },
3131
computed: {
3232
userNav () {
33-
if (Array.isArray(this.$site.themeConfig.nav)) {
34-
return this.$site.themeConfig.nav
35-
}
36-
return this.$site.themeConfig.nav[this.$basepath]
33+
const { nav } = this.$site.themeConfig
34+
if (Array.isArray(nav)) return nav
35+
if (typeof nav === 'object') return nav[this.$basepath]
36+
return []
3737
},
3838
nav () {
3939
if (this.$site.langs && this.$site.langs.length) {

0 commit comments

Comments
 (0)