swico 0.5.0-beta1 → 0.5.0-beta2
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/package.json
CHANGED
|
@@ -51,7 +51,11 @@ var getLocation = function (originalHistory) {
|
|
|
51
51
|
return {
|
|
52
52
|
hash: hash,
|
|
53
53
|
search: search,
|
|
54
|
-
pathname: pathname
|
|
54
|
+
pathname: pathname,
|
|
55
|
+
query: search ? qs_1.default.parse(search.startsWith('?') ? search.slice(1) : search) : {},
|
|
56
|
+
name: '',
|
|
57
|
+
params: {},
|
|
58
|
+
path: ''
|
|
55
59
|
};
|
|
56
60
|
};
|
|
57
61
|
var getFormatHistoryOption = function (to, formatRouterBase, pathList, type) {
|
|
@@ -112,7 +116,9 @@ var getHistory = function (routerBase, routerType) {
|
|
|
112
116
|
throw "An error occurred while executing Navigation.replace operation: unexpected type of 'to':".concat(typeof to);
|
|
113
117
|
}
|
|
114
118
|
},
|
|
115
|
-
location
|
|
119
|
+
get location() {
|
|
120
|
+
return getLocation(originalHistory);
|
|
121
|
+
}
|
|
116
122
|
};
|
|
117
123
|
return { history: history, originalHistory: originalHistory };
|
|
118
124
|
};
|
|
@@ -11,6 +11,7 @@ var Container_1 = __importDefault(require("./Container"));
|
|
|
11
11
|
var config_1 = require("./config");
|
|
12
12
|
var Layout_1 = __importDefault(require("../layout/Layout"));
|
|
13
13
|
var global_1 = __importDefault(require("../global"));
|
|
14
|
+
var qs_1 = __importDefault(require("qs"));
|
|
14
15
|
var router = (0, vue_router_1.createRouter)({
|
|
15
16
|
history: (config_1.routerType === 'hash' ? vue_router_1.createWebHashHistory : vue_router_1.createWebHistory)(config_1.routerBase),
|
|
16
17
|
routes: routes_1.default
|
|
@@ -38,7 +39,11 @@ Swico.history = {
|
|
|
38
39
|
},
|
|
39
40
|
go: router.go,
|
|
40
41
|
back: router.back,
|
|
41
|
-
|
|
42
|
+
forward: router.forward,
|
|
43
|
+
get location() {
|
|
44
|
+
var _a = router.currentRoute.value, path = _a.path, params = _a.params, query = _a.query, name = _a.name, hash = _a.hash, fullPath = _a.fullPath;
|
|
45
|
+
return { path: path, pathname: fullPath, params: params, query: query, name: name, hash: hash, search: qs_1.default.stringify(query) };
|
|
46
|
+
}
|
|
42
47
|
};
|
|
43
48
|
app.component('Layout', Layout_1.default);
|
|
44
49
|
app.use(router);
|