@nuxtjs/color-mode
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.0.3](https://github.com/nuxt-community/color-mode-module/compare/v1.0.2...v1.0.3) (2020-08-04) | ||
### Bug Fixes | ||
* handle spa fallback (regression) ([b92d64b](https://github.com/nuxt-community/color-mode-module/commit/b92d64b29a15bb901abe406aa8dda5709b5caacc)), closes [#21](https://github.com/nuxt-community/color-mode-module/issues/21) | ||
### [1.0.2](https://github.com/nuxt-community/color-mode-module/compare/v1.0.1...v1.0.2) (2020-07-28) | ||
@@ -7,0 +14,0 @@ |
@@ -12,4 +12,13 @@ import Vue from 'vue' | ||
export default function (ctx, inject) { | ||
let data = ctx.nuxtState.colorMode | ||
// For SPA mode or fallback | ||
if (!data) { | ||
data = { | ||
preference: colorMode.preference, | ||
value: colorMode.value, | ||
unknown: colorMode.preference === 'system' | ||
} | ||
} | ||
const $colorMode = new Vue({ | ||
data: ctx.nuxtState.colorMode, | ||
data, | ||
watch: { | ||
@@ -16,0 +25,0 @@ preference (preference) { |
{ | ||
"name": "@nuxtjs/color-mode", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Dark and Light mode for NuxtJS with auto detection", | ||
@@ -5,0 +5,0 @@ "repository": "nuxt-community/color-mode-module", |
20281
250