swico 0.4.0 → 0.5.0-beta1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swico",
3
- "version": "0.4.0",
3
+ "version": "0.5.0-beta1",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -46,6 +46,14 @@ var getPathNameList = function () {
46
46
  return list;
47
47
  };
48
48
  exports.pathNameList = getPathNameList();
49
+ var getLocation = function (originalHistory) {
50
+ var pathname = originalHistory.pathname, hash = originalHistory.hash, search = originalHistory.search;
51
+ return {
52
+ hash: hash,
53
+ search: search,
54
+ pathname: pathname
55
+ };
56
+ };
49
57
  var getFormatHistoryOption = function (to, formatRouterBase, pathList, type) {
50
58
  var _a;
51
59
  var params = to.params, path = to.path, hash = to.hash, name = to.name, query = to.query;
@@ -76,6 +84,7 @@ var getHistory = function (routerBase, routerType) {
76
84
  var formatRouterBase = lastIndexBase === '/' ? routerBase.slice(0, routerBase.length - 1) : routerBase;
77
85
  history = {
78
86
  go: originalHistory.go,
87
+ forward: originalHistory.forward,
79
88
  back: originalHistory.back,
80
89
  push: function (to) {
81
90
  switch (typeof to) {
@@ -102,7 +111,8 @@ var getHistory = function (routerBase, routerType) {
102
111
  default:
103
112
  throw "An error occurred while executing Navigation.replace operation: unexpected type of 'to':".concat(typeof to);
104
113
  }
105
- }
114
+ },
115
+ location: getLocation(originalHistory)
106
116
  };
107
117
  return { history: history, originalHistory: originalHistory };
108
118
  };
@@ -37,7 +37,8 @@ Swico.history = {
37
37
  }
38
38
  },
39
39
  go: router.go,
40
- back: router.back
40
+ back: router.back,
41
+ location: router.currentRoute.value
41
42
  };
42
43
  app.component('Layout', Layout_1.default);
43
44
  app.use(router);