File tree Expand file tree Collapse file tree 5 files changed +220
-113
lines changed Expand file tree Collapse file tree 5 files changed +220
-113
lines changed Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import type { ConfigProviderTheme } from ' vant'
3
+ const mode = ref <ConfigProviderTheme >(' light' )
4
+
5
+ </script >
6
+
1
7
<template >
2
- <div id = " app " >
8
+ <VanConfigProvider :theme = " mode " >
3
9
<NuxtLayout >
4
10
<NuxtPage />
5
11
</NuxtLayout >
6
- </div >
12
+ </VanConfigProvider >
7
13
</template >
8
14
9
15
<style >
10
- html ,
11
- body ,
12
16
#__nuxt {
13
17
height : 100vh ;
14
18
margin : 0 ;
15
19
padding : 0 ;
16
20
}
17
21
18
- #app {
19
- width : 100 % ;
20
- height : 100 % ;
22
+ html {
23
+ background : var ( --van-gray-1 ) ;
24
+ color-scheme : light ;
21
25
}
22
26
</style >
Original file line number Diff line number Diff line change 1
1
export default defineNuxtConfig ( {
2
- devtools : { enabled : true } ,
3
2
modules : [
4
3
'@vant/nuxt' ,
5
4
'@unocss/nuxt' ,
6
5
'nuxt-module-eslint-config' ,
7
6
] ,
8
7
9
- typescript : {
10
- shim : false ,
11
- } ,
12
-
13
8
css : [
14
9
'@unocss/reset/tailwind.css' ,
15
10
] ,
16
11
17
12
postcss : {
18
13
plugins : {
19
- // https://github.com/wswmsword/postcss-mobile-forever
20
14
'autoprefixer' : { } ,
15
+
16
+ // https://github.com/wswmsword/postcss-mobile-forever
21
17
'postcss-mobile-forever' : {
22
- appSelector : '#app ' ,
18
+ appSelector : '#__nuxt ' ,
23
19
viewportWidth : 375 ,
24
20
maxDisplayWidth : 600 ,
25
- exclude : / n o d e _ m o d u l e s / ,
21
+ // exclude: /node_modules/,
26
22
} ,
27
23
} ,
28
24
} ,
25
+
26
+ devtools : { enabled : true } ,
27
+
28
+ typescript : { shim : false } ,
29
29
} )
Original file line number Diff line number Diff line change 18
18
},
19
19
"devDependencies" : {
20
20
"@antfu/eslint-config" : " ^2.8.3" ,
21
+ "@unocss/eslint-plugin" : " ^0.58.6" ,
21
22
"@unocss/nuxt" : " ^0.58.6" ,
22
23
"@unocss/preset-rem-to-px" : " ^0.58.6" ,
23
24
"@vant/nuxt" : " ^1.0.4" ,
24
25
"eslint" : " npm:eslint-ts-patch@^8.57.0-0" ,
26
+ "eslint-plugin-format" : " ^0.1.0" ,
25
27
"eslint-ts-patch" : " ^8.57.0-0" ,
26
28
"nuxt-module-eslint-config" : " ^0.1.1" ,
27
29
"postcss-mobile-forever" : " ^4.1.2" ,
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ const menuItems = [
3
+ { title: ' 💿 Mock 指南' , route: ' mock' },
4
+ { title: ' 📊 Echarts 演示' , route: ' charts' },
5
+ { title: ' 🎨 Unocss 示例' , route: ' unocss' },
6
+ { title: ' 🍍 持久化 Pinia 状态' , route: ' counter' },
7
+ { title: ' 🙅 404页 演示' , route: ' unknown' },
8
+ ]
9
+
10
+ const checked = ref <boolean >(false )
11
+
12
+ function toggle() {
13
+ checked .value = ! checked .value
14
+ }
15
+
16
+ </script >
17
+
18
+
1
19
<template >
2
- <div class =" text-16 text-gray-800" >
3
- 你好
4
- </div >
5
- </template >
20
+ <VanCellGroup inset >
21
+ <VanCell center title =" 🌗 暗黑模式" >
22
+ <template #right-icon >
23
+ <VanSwitch v-model =" checked" size =" 20px" aria-label =" on/off Dark Mode" @click =" toggle()" />
24
+ </template >
25
+ </VanCell >
6
26
7
- <style scoped>
8
- </style >
27
+ <template v-for =" item in menuItems " :key =" item .route " >
28
+ <!-- item.route -->
29
+ <VanCell :title =" item.title" to =" /" is-link />
30
+ </template >
31
+ </VanCellGroup >
32
+ </template >
You can’t perform that action at this time.
0 commit comments