xto-fronted 0.4.88 → 0.4.89
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-BVGW4DDQ.js +189 -0
- package/dist/index-CeZ0CSSs.js +641 -0
- package/dist/index-DReodgBw.js +4233 -0
- package/dist/index-DjERNRXX.js +515 -0
- package/dist/index-gBlRG4kk.js +479 -0
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/router/layoutRoute.d.ts +5 -1
- package/package.json +1 -1
- package/src/router/layoutRoute.ts +7 -2
|
@@ -2,6 +2,9 @@ import { RouteRecordRaw, Router } from 'vue-router';
|
|
|
2
2
|
interface LayoutRouteOptions {
|
|
3
3
|
indexPath?: string;
|
|
4
4
|
}
|
|
5
|
+
interface CreateRouterOptions {
|
|
6
|
+
base?: string;
|
|
7
|
+
}
|
|
5
8
|
/**
|
|
6
9
|
* 创建布局路由
|
|
7
10
|
* @param children 子路由配置
|
|
@@ -12,7 +15,8 @@ export declare function createLayoutRoute(children: RouteRecordRaw[], options?:
|
|
|
12
15
|
/**
|
|
13
16
|
* 创建路由实例
|
|
14
17
|
* @param routes 路由配置数组
|
|
18
|
+
* @param options 配置选项
|
|
15
19
|
* @returns 路由实例
|
|
16
20
|
*/
|
|
17
|
-
export declare function createRouter(routes: RouteRecordRaw[]): Router;
|
|
21
|
+
export declare function createRouter(routes: RouteRecordRaw[], options?: CreateRouterOptions): Router;
|
|
18
22
|
export {};
|
package/package.json
CHANGED
|
@@ -10,6 +10,10 @@ interface LayoutRouteOptions {
|
|
|
10
10
|
indexPath?: string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
interface CreateRouterOptions {
|
|
14
|
+
base?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
/**
|
|
14
18
|
* 创建布局路由
|
|
15
19
|
* @param children 子路由配置
|
|
@@ -44,11 +48,12 @@ export function createLayoutRoute(
|
|
|
44
48
|
/**
|
|
45
49
|
* 创建路由实例
|
|
46
50
|
* @param routes 路由配置数组
|
|
51
|
+
* @param options 配置选项
|
|
47
52
|
* @returns 路由实例
|
|
48
53
|
*/
|
|
49
|
-
export function createRouter(routes: RouteRecordRaw[]): Router {
|
|
54
|
+
export function createRouter(routes: RouteRecordRaw[], options: CreateRouterOptions = {}): Router {
|
|
50
55
|
return vueCreateRouter({
|
|
51
|
-
history: createWebHistory(),
|
|
56
|
+
history: createWebHistory(options.base),
|
|
52
57
|
routes,
|
|
53
58
|
scrollBehavior: () => ({ left: 0, top: 0 })
|
|
54
59
|
})
|