@umijs/renderer-vue 4.0.56 → 4.0.58
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/LICENSE +21 -0
- package/dist/browser.js +11 -10
- package/dist/index.js +6 -2
- package/dist/routes.js +5 -12
- package/package.json +8 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-present ChenCheng (sorrycc@gmail.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/dist/browser.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
// @ts-ignore
|
|
3
|
-
import App from '@@/core/App.vue';
|
|
4
|
-
|
|
5
|
-
import { createApp } from 'vue';
|
|
6
|
-
|
|
3
|
+
import App from '@@/core/App.vue';
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
import { createApp } from 'vue';
|
|
6
|
+
// @ts-ignore
|
|
7
7
|
import { createRouter } from 'vue-router';
|
|
8
8
|
import { createClientRoutes } from "./routes";
|
|
9
9
|
export var AppContextKey = Symbol('AppContextKey');
|
|
@@ -13,9 +13,9 @@ export function renderClient(opts) {
|
|
|
13
13
|
routeComponents: opts.routeComponents
|
|
14
14
|
});
|
|
15
15
|
var rootContainer = App;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
for (var _i = 0, _arr = [
|
|
17
|
+
// Lowest to the highest priority
|
|
18
|
+
'innerProvider', 'i18nProvider', 'accessProvider', 'dataflowProvider', 'outerProvider', 'rootContainer']; _i < _arr.length; _i++) {
|
|
19
19
|
var key = _arr[_i];
|
|
20
20
|
rootContainer = opts.pluginManager.applyPlugins({
|
|
21
21
|
type: 'modify',
|
|
@@ -23,9 +23,9 @@ export function renderClient(opts) {
|
|
|
23
23
|
initialValue: rootContainer,
|
|
24
24
|
args: {}
|
|
25
25
|
});
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
}
|
|
28
27
|
|
|
28
|
+
// 路由配置
|
|
29
29
|
var routerConfig = opts.pluginManager.applyPlugins({
|
|
30
30
|
key: 'router',
|
|
31
31
|
type: 'modify',
|
|
@@ -52,8 +52,9 @@ export function renderClient(opts) {
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
app.use(router);
|
|
55
|
-
app.mount(opts.rootElement);
|
|
55
|
+
app.mount(opts.rootElement);
|
|
56
56
|
|
|
57
|
+
// 注入appData 数据
|
|
57
58
|
app.provide(AppContextKey, {
|
|
58
59
|
routes: opts.routes,
|
|
59
60
|
routeComponents: opts.routeComponents,
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
|
+
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
export { createMemoryHistory, createRouter, createWebHashHistory, createWebHistory, onBeforeRouteLeave, onBeforeRouteUpdate, RouterLink, RouterView, useLink, useRoute, useRouter
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
} from 'vue-router';
|
|
7
|
+
|
|
2
8
|
// @ts-ignore
|
|
3
|
-
export { createMemoryHistory, createRouter, createWebHashHistory, createWebHistory, onBeforeRouteLeave, onBeforeRouteUpdate, RouterLink, RouterView, useLink, useRoute, useRouter // @ts-ignore
|
|
4
|
-
} from 'vue-router'; // @ts-ignore
|
|
5
9
|
|
|
6
10
|
export { AppContextKey, renderClient } from "./browser";
|
package/dist/routes.js
CHANGED
|
@@ -3,8 +3,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
var _excluded = ["id", "path", "redirect"];
|
|
4
4
|
export function createClientRoutes(opts) {
|
|
5
5
|
var routesById = opts.routesById,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
parentId = opts.parentId,
|
|
7
|
+
routeComponents = opts.routeComponents;
|
|
8
8
|
return Object.keys(routesById).filter(function (id) {
|
|
9
9
|
return routesById[id].parentId === parentId;
|
|
10
10
|
}).map(function (id) {
|
|
@@ -18,24 +18,20 @@ export function createClientRoutes(opts) {
|
|
|
18
18
|
routeComponents: routeComponents,
|
|
19
19
|
parentId: route.id
|
|
20
20
|
});
|
|
21
|
-
|
|
22
21
|
if (children.length > 0) {
|
|
23
22
|
// @ts-ignore
|
|
24
23
|
route.children = children;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
delete route.id;
|
|
28
26
|
return route;
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
29
|
export function createClientRoute(opts) {
|
|
32
30
|
var route = opts.route;
|
|
33
|
-
|
|
34
31
|
var id = route.id,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
path = route.path,
|
|
33
|
+
redirect = route.redirect,
|
|
34
|
+
other = _objectWithoutProperties(route, _excluded);
|
|
39
35
|
if (redirect) {
|
|
40
36
|
return _objectSpread(_objectSpread({}, other), {}, {
|
|
41
37
|
id: id,
|
|
@@ -43,17 +39,14 @@ export function createClientRoute(opts) {
|
|
|
43
39
|
redirect: redirect
|
|
44
40
|
});
|
|
45
41
|
}
|
|
46
|
-
|
|
47
42
|
var item = _objectSpread(_objectSpread({}, other), {}, {
|
|
48
43
|
id: id,
|
|
49
44
|
component: opts.routeComponent,
|
|
50
45
|
path: path
|
|
51
46
|
});
|
|
52
|
-
|
|
53
47
|
if (route.parentId === undefined && path && !path.startsWith('/')) {
|
|
54
48
|
// fix Uncaught (in promise) Error: Route paths should start with a "/": "users" should be "/users".
|
|
55
49
|
item.path = "/".concat(path);
|
|
56
50
|
}
|
|
57
|
-
|
|
58
51
|
return item;
|
|
59
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/renderer-vue",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.58",
|
|
4
4
|
"description": "@umijs/renderer-vue",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-vue#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -15,11 +15,6 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "umi-scripts father build",
|
|
20
|
-
"build:deps": "umi-scripts bundleDeps",
|
|
21
|
-
"dev": "umi-scripts father dev"
|
|
22
|
-
},
|
|
23
18
|
"dependencies": {
|
|
24
19
|
"@babel/runtime": "7.21.0"
|
|
25
20
|
},
|
|
@@ -32,5 +27,10 @@
|
|
|
32
27
|
},
|
|
33
28
|
"authors": [
|
|
34
29
|
"chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
|
|
35
|
-
]
|
|
36
|
-
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "umi-scripts father build",
|
|
33
|
+
"build:deps": "umi-scripts bundleDeps",
|
|
34
|
+
"dev": "umi-scripts father dev"
|
|
35
|
+
}
|
|
36
|
+
}
|