File tree Expand file tree Collapse file tree 15 files changed +99
-136
lines changed Expand file tree Collapse file tree 15 files changed +99
-136
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ onMounted(() => {
33
33
34
34
<template >
35
35
<VanConfigProvider :theme =" mode" >
36
+ <NavBar />
36
37
<router-view v-slot =" { Component, route }" >
37
38
<transition :name =" routeTransitionName" >
38
39
<div :key =" route.name" class =" app-wrapper" >
@@ -45,11 +46,11 @@ onMounted(() => {
45
46
46
47
<style scoped>
47
48
.app-wrapper {
48
- position : absolute ;
49
- top : 0 ;
50
- left : 0 ;
51
49
width : 100% ;
52
50
height : 100% ;
51
+ position : absolute ;
52
+ top : 46px ;
53
+ left : 0 ;
53
54
overflow-y : auto ;
54
55
}
55
56
</style >
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export {}
8
8
declare module 'vue' {
9
9
export interface GlobalComponents {
10
10
Chart : typeof import ( './components/chart/index.vue' ) [ 'default' ]
11
- Container : typeof import ( './components/container/index .vue' ) [ 'default' ]
11
+ NavBar : typeof import ( './components/NavBar .vue' ) [ 'default' ]
12
12
RouterLink : typeof import ( 'vue-router' ) [ 'RouterLink' ]
13
13
RouterView : typeof import ( 'vue-router' ) [ 'RouterView' ]
14
14
VanButton : typeof import ( 'vant/es' ) [ 'Button' ]
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ const route = useRoute ()
3
+ const router = useRouter ()
4
+
5
+ function onBack() {
6
+ if (history .length > 1 )
7
+ history .back ()
8
+ else
9
+ router .replace (' /' )
10
+ }
11
+
12
+ const title = computed (() => {
13
+ const { title } = (route .meta as { title? : string }) || {}
14
+ return title || ' '
15
+ })
16
+ </script >
17
+
18
+ <template >
19
+ <VanNavBar
20
+ v-show =" title"
21
+ :title =" title"
22
+ :fixed =" true"
23
+ left-arrow clickable
24
+ @click-left =" onBack"
25
+ />
26
+ </template >
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -15,7 +15,3 @@ const router = useRouter()
15
15
</div >
16
16
</main >
17
17
</template >
18
-
19
- <style scoped>
20
-
21
- </style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <main text =" gray-700 dark:gray-200" >
2
+ <main p = " 16 " text =" gray-700 dark:gray-200" >
3
3
<RouterView />
4
4
5
- <div mx-auto mt -15 text-center text-14 opacity-50 >
5
+ <div mx-auto py -15 text-center text-14 opacity-50 >
6
6
Default Layout
7
7
</div >
8
8
</main >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <main py-20 text =" gray-700 dark:gray-200" >
2
+ <main text =" gray-700 dark:gray-200" >
3
3
<RouterView />
4
4
5
5
<div mx-auto mt-15 text-center text-14 opacity-50 >
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ definePage({
3
3
name: ' charts' ,
4
4
meta: {
5
5
level: 2 ,
6
+ title: ' 📊 Echarts 演示' ,
6
7
},
7
8
})
8
9
@@ -62,38 +63,12 @@ const scoreOption = {
62
63
const refBarOption = ref (barOption )
63
64
const refLineOption = ref (lineOption )
64
65
const refScoreOption = ref (scoreOption )
65
-
66
- // back
67
- const onClickLeft = () => history .back ()
68
66
</script >
69
67
70
68
<template >
71
69
<div >
72
- <VanNavBar title =" 📊 Echarts" left-arrow fixed @click-left =" onClickLeft" />
73
-
74
- <Container >
75
- <div class =" chart" >
76
- <Chart :option =" refBarOption" :style =" { height: '330px' }" />
77
- </div >
78
-
79
- <div class =" chart item" >
80
- <Chart :option =" refLineOption" :style =" { height: '330px' }" />
81
- </div >
82
-
83
- <div class =" chart item" >
84
- <Chart :option =" refScoreOption" :style =" { height: '330px' }" />
85
- </div >
86
- </Container >
70
+ <Chart :option =" refBarOption" :style =" { height: '330px' }" />
71
+ <Chart :option =" refLineOption" :style =" { height: '330px' }" />
72
+ <Chart :option =" refScoreOption" :style =" { height: '330px' }" />
87
73
</div >
88
74
</template >
89
-
90
- <style lang="less" scoped>
91
- .chart {
92
- width : 100% ;
93
- height : 300px ;
94
- }
95
-
96
- .chart.item {
97
- margin-top : 15px ;
98
- }
99
- </style >
You can’t perform that action at this time.
0 commit comments