Installed nuxt-color-mode following their official Docs. Though, when loading the page I'm getting Cannot read properties of undefined (reading 'value')
npm install --save-dev @nuxtjs/color-mode
Added to nuxt.config.js
buildModules: [
// https://go.nuxtjs.dev/tailwindcss
'@nuxtjs/tailwindcss',
'@nuxtjs/color-mode'
],
Then within index.vue I've added:
<script>
export default {
name: 'IndexPage',
colorMode: 'light',
}
</script>
Unsure why the following line is causing an error:
<h1>Color mode: {{ $colorMode.value }}</h1> it's also not adding a class to the <html> element.
Have I done something wrong here?