@zat-design/sisyphus-react 3.2.0-beta.2 → 3.2.1

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.
@@ -331,7 +331,7 @@
331
331
  line-height: initial !important;
332
332
  height: auto !important;
333
333
  margin: 0;
334
- padding-top: 12px 0;
334
+ padding: 12px 0;
335
335
  min-height: 48px;
336
336
  }
337
337
  .pro-layout-open-menu .ant-menu-title-content div {
@@ -3,7 +3,7 @@ import _Menu from "antd/es/menu";
3
3
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
6
- import { useMemo, useRef, useEffect, useContext } from 'react';
6
+ import { useMemo, useRef, useContext } from 'react';
7
7
  import { useDeepCompareEffect, useSetState } from 'ahooks';
8
8
  import { CaretDownOutlined } from '@ant-design/icons';
9
9
  import classnames from 'classnames';
@@ -122,18 +122,6 @@ var OpenMenu = function OpenMenu(props) {
122
122
  });
123
123
  }
124
124
  }, [sideMenu]);
125
- useEffect(function () {
126
- // 同步路由,解决进入详情页后router没有变化,点击相同router菜单无效问题
127
- setState({
128
- router: window.location.pathname
129
- });
130
- }, [window.location.pathname]);
131
- useEffect(function () {
132
- // 路由变更,且不再demo文档中
133
- if (router && !window.location.href.includes('~demos/prolayout')) {
134
- linkRef.current.click();
135
- }
136
- }, [router]);
137
125
  return _jsxs("div", {
138
126
  className: cls,
139
127
  style: style,
@@ -162,6 +150,12 @@ var OpenMenu = function OpenMenu(props) {
162
150
  onSelected({
163
151
  selectedPath: item === null || item === void 0 ? void 0 : (_item$props2 = item.props) === null || _item$props2 === void 0 ? void 0 : _item$props2.router
164
152
  });
153
+ setTimeout(function () {
154
+ // 路由变更,且不再demo文档中
155
+ if (!window.location.href.includes('~demos/prolayout')) {
156
+ linkRef.current.click();
157
+ }
158
+ }, 100);
165
159
  },
166
160
  style: {
167
161
  height: dataSource.sideMenu ? 'auto' : "calc(100vh - ".concat((dataSource === null || dataSource === void 0 ? void 0 : dataSource.height) || 0, "px)"),
@@ -93,7 +93,7 @@
93
93
  line-height: initial !important;
94
94
  height : auto !important;
95
95
  margin : 0;
96
- padding-top: 12px 0;
96
+ padding: 12px 0;
97
97
  min-height : 48px;
98
98
  }
99
99
 
@@ -128,18 +128,6 @@ var OpenMenu = function OpenMenu(props) {
128
128
  });
129
129
  }
130
130
  }, [sideMenu]);
131
- (0, _react.useEffect)(function () {
132
- // 同步路由,解决进入详情页后router没有变化,点击相同router菜单无效问题
133
- setState({
134
- router: window.location.pathname
135
- });
136
- }, [window.location.pathname]);
137
- (0, _react.useEffect)(function () {
138
- // 路由变更,且不再demo文档中
139
- if (router && !window.location.href.includes('~demos/prolayout')) {
140
- linkRef.current.click();
141
- }
142
- }, [router]);
143
131
  return (0, _jsxRuntime.jsxs)("div", {
144
132
  className: cls,
145
133
  style: style,
@@ -168,6 +156,12 @@ var OpenMenu = function OpenMenu(props) {
168
156
  onSelected({
169
157
  selectedPath: item === null || item === void 0 ? void 0 : (_item$props2 = item.props) === null || _item$props2 === void 0 ? void 0 : _item$props2.router
170
158
  });
159
+ setTimeout(function () {
160
+ // 路由变更,且不再demo文档中
161
+ if (!window.location.href.includes('~demos/prolayout')) {
162
+ linkRef.current.click();
163
+ }
164
+ }, 100);
171
165
  },
172
166
  style: {
173
167
  height: dataSource.sideMenu ? 'auto' : "calc(100vh - ".concat((dataSource === null || dataSource === void 0 ? void 0 : dataSource.height) || 0, "px)"),
@@ -93,7 +93,7 @@
93
93
  line-height: initial !important;
94
94
  height : auto !important;
95
95
  margin : 0;
96
- padding-top: 12px 0;
96
+ padding: 12px 0;
97
97
  min-height : 48px;
98
98
  }
99
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.2.0-beta.2",
3
+ "version": "3.2.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",