@cloud-app-dev/vidc 2.0.0-alpha.29 → 2.0.0-alpha.31
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/es/AppRoute/index.d.ts +2 -0
- package/es/AppRoute/index.js +22 -4
- package/package.json +1 -1
package/es/AppRoute/index.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ import { IAppRouteProps } from './interface';
|
|
|
3
3
|
declare class AppRoute extends React.Component<IAppRouteProps, any> {
|
|
4
4
|
static defaultProps: IAppRouteProps;
|
|
5
5
|
constructor(props: IAppRouteProps);
|
|
6
|
+
componentDidMount(): void;
|
|
6
7
|
shouldComponentUpdate(props: IAppRouteProps): boolean;
|
|
7
8
|
componentWillUnmount(): void;
|
|
9
|
+
updateMatchIndex: (index: number) => void;
|
|
8
10
|
render(): JSX.Element;
|
|
9
11
|
}
|
|
10
12
|
export default AppRoute;
|
package/es/AppRoute/index.js
CHANGED
|
@@ -49,6 +49,21 @@ var AppRoute = /*#__PURE__*/function (_React$Component) {
|
|
|
49
49
|
_classCallCheck(this, AppRoute);
|
|
50
50
|
|
|
51
51
|
_this = _super.call(this, props);
|
|
52
|
+
|
|
53
|
+
_this.updateMatchIndex = function (index) {
|
|
54
|
+
if (!_global._IS_RUN_MICRO_BASIC) {
|
|
55
|
+
return _this.setState({
|
|
56
|
+
matchIndex: index
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (_this.state.index !== -1) {
|
|
61
|
+
return _this.setState({
|
|
62
|
+
matchIndex: index
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
52
67
|
_this.state = {
|
|
53
68
|
matchIndex: -1
|
|
54
69
|
};
|
|
@@ -56,9 +71,14 @@ var AppRoute = /*#__PURE__*/function (_React$Component) {
|
|
|
56
71
|
}
|
|
57
72
|
|
|
58
73
|
_createClass(AppRoute, [{
|
|
74
|
+
key: "componentDidMount",
|
|
75
|
+
value: function componentDidMount() {
|
|
76
|
+
console.debug("App Routes\uFF1A".concat(JSON.stringify(this.props.routes)));
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
59
79
|
key: "shouldComponentUpdate",
|
|
60
80
|
value: function shouldComponentUpdate(props) {
|
|
61
|
-
var tabId =
|
|
81
|
+
var tabId = _cache.getCache('currentTabKey', 'session');
|
|
62
82
|
|
|
63
83
|
if (!_global._IS_RUN_MICRO_BASIC) {
|
|
64
84
|
return true;
|
|
@@ -93,9 +113,7 @@ var AppRoute = /*#__PURE__*/function (_React$Component) {
|
|
|
93
113
|
key: item.path,
|
|
94
114
|
element: /*#__PURE__*/React.createElement(RenderSingleRoute, {
|
|
95
115
|
onMount: function onMount() {
|
|
96
|
-
return _this2.
|
|
97
|
-
matchIndex: index
|
|
98
|
-
});
|
|
116
|
+
return _this2.updateMatchIndex(index);
|
|
99
117
|
}
|
|
100
118
|
})
|
|
101
119
|
});
|