Skip to content

Commit 18c496a

Browse files
fix: banner bug, breaking search (#988)
1 parent 366b69f commit 18c496a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/.vuepress/theme/layouts/Layout.vue

+3-5
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,16 @@ export default {
134134
}
135135
},
136136
137-
beforeMount() {
138-
this.isBannerOpen = !localStorage.getItem(this.nameStorage)
139-
},
140-
141137
mounted() {
142138
this.$router.afterEach(() => {
143139
this.isSidebarOpen = false
144140
})
145141
142+
this.isBannerOpen = !localStorage.getItem(this.nameStorage)
143+
146144
// Load component according to user preferences
147145
if (this.isBannerOpen) {
148-
this.initBanner()
146+
this.$nextTick(this.initBanner)
149147
}
150148
},
151149

0 commit comments

Comments
 (0)