File tree Expand file tree Collapse file tree 4 files changed +26
-5
lines changed Expand file tree Collapse file tree 4 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ const route = useRoute ()
3+ const toPath = computed (() => route .path .split (' /' ).slice (0 , - 1 ).join (' /' ) || ' /' )
4+ </script >
5+
16<template >
2- <nuxt-link v-if =" $route.path !== '/'" :to =" $route.path.split('/').slice(0, -1).join('/') || '/' " >
7+ <nuxt-link v-if =" $route.path !== '/'" :to =" toPath " >
38 cd ..
49 </nuxt-link >
510</template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ const colorMode = useColorMode ()
3+
4+ function changePreference() {
5+ if (colorMode .preference === ' light' ) {
6+ colorMode .preference = ' dark'
7+ } else if (colorMode .preference === ' dark' ) {
8+ colorMode .preference = ' system'
9+ } else {
10+ colorMode .preference = ' light'
11+ }
12+ }
13+ </script >
14+
115<template >
216 <color-scheme >
317 <button
4- class =" i-mdi-weather-sunny dark:i-mdi-weather-night font-size-[24px]"
5- @click =" $colorMode.preference = $colorMode.preference === 'dark' ? 'light' : 'dark'"
18+ class =" font-size-[24px]"
19+ :class =" [$colorMode.preference === 'system' ? 'i-mdi-monitor' : 'i-mdi-weather-sunny dark:i-mdi-weather-night']"
20+ @click =" changePreference"
621 />
722 <template #placeholder >
823 <div class =" i-mdi-weather-sunny font-size-[24px]" />
Original file line number Diff line number Diff line change 1414<style lang="scss" module>
1515.dashed_link {
1616 a {
17- --at-apply : " underline-dashed hover:underline-solid"
18- }
17+ --at-apply : " underline-dashed hover:underline-solid"
18+ }
1919}
2020 </style >
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export default withNuxt(antfu({
1212 'curly' : [ 'error' , 'all' ] ,
1313 'no-console' : 'warn' ,
1414
15+ 'style/brace-style' : [ 'error' , '1tbs' ] ,
1516 'style/max-len' : [ 'error' , { code : 120 } ] ,
1617
1718 'vue/component-name-in-template-casing' : [ 'error' , 'kebab-case' ] ,
You can’t perform that action at this time.
0 commit comments