Skip to content

Commit c4e47fc

Browse files
committed
feat: 空示例模块
1 parent 864be5f commit c4e47fc

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

src/pages/home/components/Title.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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>

src/pages/home/index.vue

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
<script setup lang="ts">
2-
import { demoRoutes, systemRoutes } from "@/router"
2+
import { demoRoutes, emptyDemoRoutes, systemRoutes } from "@/router"
33
import Description from "@@/components/Description.vue"
44
import Cell from "./components/Cell.vue"
5+
import Title from "./components/Title.vue"
56
</script>
67

78
<template>
89
<div un-px-20px un-py-26px un-select-none>
910
<Description un-pl-16px />
1011
<div un-mt-40px>
11-
<span un-pl-16px un-color-hex-969799 un-text-14px un-fw400>
12-
示例集合
13-
</span>
12+
<Title text="示例集合" />
1413
<Cell
1514
v-for="route in [...demoRoutes, ...systemRoutes]"
1615
:key="route.path"
1716
:title="route.meta?.title || ''"
1817
:path="route.path"
1918
un-mt-12px
2019
/>
21-
<van-divider>🔥 更多优秀示例,期待你的 PR 👏🏻</van-divider>
2220
</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>
2332
</div>
2433
</template>

src/router/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ export const demoRoutes: RouteRecordRaw[] = [
140140
}
141141
}
142142
}
143-
},
143+
}
144+
]
145+
146+
export const emptyDemoRoutes: RouteRecordRaw[] = [
144147
{
145148
path: "/i18n",
146149
component: () => import("@/pages/demo/i18n.vue"),
@@ -160,7 +163,7 @@ export const demoRoutes: RouteRecordRaw[] = [
160163
/** 路由实例 */
161164
export const router = createRouter({
162165
history: VITE_ROUTER_HISTORY === "hash" ? createWebHashHistory(VITE_PUBLIC_PATH) : createWebHistory(VITE_PUBLIC_PATH),
163-
routes: [...systemRoutes, ...routes, ...demoRoutes]
166+
routes: [...systemRoutes, ...routes, ...demoRoutes, ...emptyDemoRoutes]
164167
})
165168

166169
// 注册路由导航守卫

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy