File tree Expand file tree Collapse file tree 3 files changed +32
-7
lines changed Expand file tree Collapse file tree 3 files changed +32
-7
lines changed Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ interface Props {
3
+ text: string
4
+ }
5
+
6
+ const props = defineProps <Props >()
7
+ </script >
8
+
9
+ <template >
10
+ <span un-pl-16px un-color-hex-969799 un-text-14px un-fw400 >
11
+ {{ props.text }}
12
+ </span >
13
+ </template >
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import { demoRoutes , systemRoutes } from " @/router"
2
+ import { demoRoutes , emptyDemoRoutes , systemRoutes } from " @/router"
3
3
import Description from " @@/components/Description.vue"
4
4
import Cell from " ./components/Cell.vue"
5
+ import Title from " ./components/Title.vue"
5
6
</script >
6
7
7
8
<template >
8
9
<div un-px-20px un-py-26px un-select-none >
9
10
<Description un-pl-16px />
10
11
<div un-mt-40px >
11
- <span un-pl-16px un-color-hex-969799 un-text-14px un-fw400 >
12
- 示例集合
13
- </span >
12
+ <Title text =" 示例集合" />
14
13
<Cell
15
14
v-for =" route in [...demoRoutes, ...systemRoutes]"
16
15
:key =" route.path"
17
16
:title =" route.meta?.title || ''"
18
17
:path =" route.path"
19
18
un-mt-12px
20
19
/>
21
- <van-divider >🔥 更多优秀示例,期待你的 PR 👏🏻</van-divider >
22
20
</div >
21
+ <div un-my-20px >
22
+ <Title text =" 空示例集合" />
23
+ <Cell
24
+ v-for =" route in emptyDemoRoutes"
25
+ :key =" route.path"
26
+ :title =" route.meta?.title || ''"
27
+ :path =" route.path"
28
+ un-mt-12px
29
+ />
30
+ </div >
31
+ <van-divider >🔥 更多优秀示例,期待你的 PR 👏🏻</van-divider >
23
32
</div >
24
33
</template >
Original file line number Diff line number Diff line change @@ -140,7 +140,10 @@ export const demoRoutes: RouteRecordRaw[] = [
140
140
}
141
141
}
142
142
}
143
- } ,
143
+ }
144
+ ]
145
+
146
+ export const emptyDemoRoutes : RouteRecordRaw [ ] = [
144
147
{
145
148
path : "/i18n" ,
146
149
component : ( ) => import ( "@/pages/demo/i18n.vue" ) ,
@@ -160,7 +163,7 @@ export const demoRoutes: RouteRecordRaw[] = [
160
163
/** 路由实例 */
161
164
export const router = createRouter ( {
162
165
history : VITE_ROUTER_HISTORY === "hash" ? createWebHashHistory ( VITE_PUBLIC_PATH ) : createWebHistory ( VITE_PUBLIC_PATH ) ,
163
- routes : [ ...systemRoutes , ...routes , ...demoRoutes ]
166
+ routes : [ ...systemRoutes , ...routes , ...demoRoutes , ... emptyDemoRoutes ]
164
167
} )
165
168
166
169
// 注册路由导航守卫
You can’t perform that action at this time.
0 commit comments