Skip to content

Commit

Permalink
fix: hydration error
Browse files Browse the repository at this point in the history
  • Loading branch information
sfxcode committed Aug 4, 2024
1 parent dc1351b commit 240a252
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions app/components/app/AppColorMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ watchEffect(() => mode.value = state.value)

<template>
<div>
<Button @click="next()">
<i v-if="mode === 'dark'" i-carbon-moon inline-block align-middle class="align-middle" />
<i v-if="mode === 'light'" i-carbon-sun inline-block align-middle class="align-middle" />
<i v-if="mode === 'cafe'" i-carbon-cafe inline-block align-middle class="align-middle" />
<i v-if="mode === 'contrast'" i-carbon-contrast inline-block align-middle class="align-middle" />
<i v-if="mode === 'auto'" i-carbon-laptop inline-block align-middle class="align-middle" />

<span class="ml-2 capitalize">{{ mode }}</span>
</Button>
<client-only>
<Button @click="next()">
<i v-if="mode === 'dark'" i-carbon-moon inline-block align-middle class="align-middle" />
<i v-if="mode === 'light'" i-carbon-sun inline-block align-middle class="align-middle" />
<i v-if="mode === 'cafe'" i-carbon-cafe inline-block align-middle class="align-middle" />
<i v-if="mode === 'contrast'" i-carbon-contrast inline-block align-middle class="align-middle" />
<i v-if="mode === 'auto'" i-carbon-laptop inline-block align-middle class="align-middle" />
<span class="ml-2 capitalize">{{ mode }}</span>
</Button>
</client-only>
</div>
</template>

Expand Down

0 comments on commit 240a252

Please sign in to comment.