@xfe-repo/web-micro 1.1.7 → 1.1.8

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -305,13 +305,19 @@ var import_micro_app = __toESM(require("@micro-zoe/micro-app"));
305
305
  var import_jsx_custom_event = __toESM(require("@micro-zoe/micro-app/polyfill/jsx-custom-event.js"));
306
306
  var MicroAppRoute = (0, import_react.memo)(function(props) {
307
307
  var name = props.name, baseRoute = props.baseRoute, url = props.url, keepAlive = props.keepAlive, className = props.className, data = props.data, loadingFallback = props.loadingFallback, errorFallback = props.errorFallback;
308
+ var navigate = (0, import_web_router.useNavigate)();
308
309
  var location = (0, import_web_router.useLocation)();
309
- var defaultPage = location.pathname + location.search;
310
310
  var _ref = _sliced_to_array((0, import_react.useState)(false), 2), microAppIsShow = _ref[0], setMicroAppIsShow = _ref[1];
311
311
  var _ref1 = _sliced_to_array((0, import_react.useState)(false), 2), microAppIsError = _ref1[0], setMicroAppIsError = _ref1[1];
312
312
  var handleMicroAppMounted = (0, import_react.useCallback)(function() {
313
+ var path = location.pathname + location.search;
314
+ navigate(path, {
315
+ replace: true
316
+ });
313
317
  setMicroAppIsShow(true);
314
- }, []);
318
+ }, [
319
+ location
320
+ ]);
315
321
  var handleMicroAppAfterShow = (0, import_react.useCallback)(function() {
316
322
  var path = location.pathname + location.search;
317
323
  import_micro_app.default.router.push({
@@ -319,7 +325,7 @@ var MicroAppRoute = (0, import_react.memo)(function(props) {
319
325
  path: path,
320
326
  replace: true
321
327
  }).catch(function(e) {
322
- return e;
328
+ return console.error(e);
323
329
  });
324
330
  setMicroAppIsShow(true);
325
331
  }, [
@@ -332,6 +338,8 @@ var MicroAppRoute = (0, import_react.memo)(function(props) {
332
338
  className: className
333
339
  }, microAppIsError && errorFallback, !microAppIsShow && !microAppIsError && loadingFallback, /* @__PURE__ */ (0, import_jsx_custom_event.default)("micro-app", {
334
340
  style: {
341
+ width: "100%",
342
+ height: "100%",
335
343
  display: microAppIsShow ? "block" : "none"
336
344
  },
337
345
  url: url,
@@ -339,7 +347,6 @@ var MicroAppRoute = (0, import_react.memo)(function(props) {
339
347
  "router-mode": "native",
340
348
  baseroute: baseRoute ? baseRoute : "/".concat(name),
341
349
  "keep-alive": keepAlive,
342
- "default-page": defaultPage,
343
350
  data: data,
344
351
  onMounted: handleMicroAppMounted,
345
352
  onAftershow: keepAlive ? handleMicroAppAfterShow : void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfe-repo/web-micro",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "sideEffects": false,
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,8 +8,8 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "@micro-zoe/micro-app": "1.0.0-rc.13",
12
- "@xfe-repo/web-router": "1.1.5",
11
+ "@micro-zoe/micro-app": "1.0.0-rc.15",
12
+ "@xfe-repo/web-router": "1.1.6",
13
13
  "@xfe-repo/web-utils": "1.1.4"
14
14
  },
15
15
  "devDependencies": {