xto-fronted 0.4.95 → 0.4.96

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.
@@ -1,6 +1,7 @@
1
1
  import { RouteRecordRaw, Router } from 'vue-router';
2
2
  interface LayoutRouteOptions {
3
3
  indexPath?: string;
4
+ logoSrc?: string;
4
5
  }
5
6
  interface CreateRouterOptions {
6
7
  base?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xto-fronted",
3
- "version": "0.4.95",
3
+ "version": "0.4.96",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "XTO 前端应用框架",
@@ -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 } 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 = {
@@ -39,7 +42,7 @@ export function createLayoutRoute(
39
42
  return {
40
43
  path: '/',
41
44
  name: 'Layout',
42
- component: Layout,
45
+ component: () => h(Layout, { logoSrc }),
43
46
  redirect: indexPath,
44
47
  children: [...children, catchAllRoute]
45
48
  }