Skip to content

Commit 139b0e6

Browse files
authored
fix: spa mode
1 parent 2ec55d6 commit 139b0e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/templates/plugin.client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const colorMode = window['<%= options.globalName %>']
88
const getForcedColorMode = route => route.matched[0] && route.matched[0].components.default.options.colorMode
99

1010
export default function (ctx, inject) {
11-
let data = ctx.nuxtState.colorMode
11+
let data = ctx.nuxtState ? ctx.nuxtState.colorMode : null
1212
// For SPA mode or fallback
1313
if (!data) {
1414
data = {

0 commit comments

Comments
 (0)