@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.
- package/dist/index.esm.css +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +7 -13
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -12
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +1 -1
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -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,
|
|
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)"),
|
|
@@ -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)"),
|