xto-fronted 0.4.95 → 0.4.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-BfXnrw05.js +515 -0
- package/dist/index-Bmb0rt9C.js +641 -0
- package/dist/index-C1j4f3mM.js +479 -0
- package/dist/index-C3K89jzC.js +515 -0
- package/dist/index-CVH7bDsl.js +4285 -0
- package/dist/index-Ccp6zfq-.js +4290 -0
- package/dist/index-CvQgEgUM.js +641 -0
- package/dist/index-DHH8Os_2.js +189 -0
- package/dist/index-DjXyzwL0.js +479 -0
- package/dist/index-WPRGF_GX.js +189 -0
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/router/layoutRoute.d.ts +1 -0
- package/package.json +1 -1
- package/src/router/layoutRoute.ts +12 -1
package/package.json
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import { createRouter as vueCreateRouter, createWebHistory } from 'vue-router'
|
|
6
6
|
import type { RouteRecordRaw, Router } from 'vue-router'
|
|
7
|
+
import { h, defineComponent } from 'vue'
|
|
7
8
|
import Layout from '@/components/Layout/index.vue'
|
|
8
9
|
|
|
9
10
|
interface LayoutRouteOptions {
|
|
10
11
|
indexPath?: string
|
|
12
|
+
logoSrc?: string
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
interface CreateRouterOptions {
|
|
@@ -25,6 +27,7 @@ export function createLayoutRoute(
|
|
|
25
27
|
options: LayoutRouteOptions = {}
|
|
26
28
|
): RouteRecordRaw {
|
|
27
29
|
const indexPath = options.indexPath || '/dashboard'
|
|
30
|
+
const logoSrc = options.logoSrc || '/vite.svg'
|
|
28
31
|
|
|
29
32
|
// 添加 catch-all 路由,让404在Layout内部渲染,保持左侧菜单显示
|
|
30
33
|
const catchAllRoute: RouteRecordRaw = {
|
|
@@ -36,10 +39,18 @@ export function createLayoutRoute(
|
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
|
|
42
|
+
// 创建带 props 的 Layout 包装组件
|
|
43
|
+
const LayoutWrapper = defineComponent({
|
|
44
|
+
name: 'LayoutWrapper',
|
|
45
|
+
render() {
|
|
46
|
+
return h(Layout, { logoSrc })
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
39
50
|
return {
|
|
40
51
|
path: '/',
|
|
41
52
|
name: 'Layout',
|
|
42
|
-
component:
|
|
53
|
+
component: LayoutWrapper,
|
|
43
54
|
redirect: indexPath,
|
|
44
55
|
children: [...children, catchAllRoute]
|
|
45
56
|
}
|