swico 0.9.1-beta2 → 0.9.2-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.9.1-beta2",
3
+ "version": "0.9.2-beta1",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -1,4 +1,19 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
2
17
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
18
  if (k2 === undefined) k2 = k;
4
19
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -36,6 +51,19 @@ require("../../global");
36
51
  var layout_1 = __importDefault(require("../../layout"));
37
52
  var routes_1 = __importDefault(require("./routes"));
38
53
  var config_1 = require("./config");
54
+ var Container = (function (_super) {
55
+ __extends(Container, _super);
56
+ function Container() {
57
+ return _super !== null && _super.apply(this, arguments) || this;
58
+ }
59
+ Container.prototype.componentDidCatch = function (error, errorInfo) {
60
+ console.error(error);
61
+ };
62
+ Container.prototype.render = function () {
63
+ return this.props.children;
64
+ };
65
+ return Container;
66
+ }(react_1.default.Component));
39
67
  var getChildrenRouteList = function (childrenRoutes, ancPathKey) {
40
68
  return childrenRoutes === null || childrenRoutes === void 0 ? void 0 : childrenRoutes.map(function (item) {
41
69
  var component = item.component, path = item.path, children = item.children, redirect = item.redirect;
@@ -52,7 +80,8 @@ exports.getChildrenRouteList = getChildrenRouteList;
52
80
  var App = function () {
53
81
  var routeList = [
54
82
  {
55
- element: react_1.default.createElement(layout_1.default, null),
83
+ element: (react_1.default.createElement(Container, null,
84
+ react_1.default.createElement(layout_1.default, null))),
56
85
  path: '/',
57
86
  children: (0, exports.getChildrenRouteList)(routes_1.default, '')
58
87
  }
@@ -1,4 +1,11 @@
1
- <script setup lang="ts"></script>
1
+ <script setup lang="ts">
2
+ import { onErrorCaptured } from 'vue';
3
+
4
+ onErrorCaptured((err, instance, info) => {
5
+ console.error(err);
6
+ return false;
7
+ });
8
+ </script>
2
9
 
3
10
  <template>
4
11
  <Layout><RouterView /></Layout>