File tree 4 files changed +26
-5
lines changed
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
+
1
6
<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 " >
3
8
cd ..
4
9
</nuxt-link >
5
10
</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
+
1
15
<template >
2
16
<color-scheme >
3
17
<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"
6
21
/>
7
22
<template #placeholder >
8
23
<div class =" i-mdi-weather-sunny font-size-[24px]" />
Original file line number Diff line number Diff line change 14
14
<style lang="scss" module>
15
15
.dashed_link {
16
16
a {
17
- --at-apply : " underline-dashed hover:underline-solid"
18
- }
17
+ --at-apply : " underline-dashed hover:underline-solid"
18
+ }
19
19
}
20
20
</style >
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export default withNuxt(antfu({
12
12
'curly' : [ 'error' , 'all' ] ,
13
13
'no-console' : 'warn' ,
14
14
15
+ 'style/brace-style' : [ 'error' , '1tbs' ] ,
15
16
'style/max-len' : [ 'error' , { code : 120 } ] ,
16
17
17
18
'vue/component-name-in-template-casing' : [ 'error' , 'kebab-case' ] ,
You can’t perform that action at this time.
0 commit comments