ztxkutils 2.10.5 → 2.10.6
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/useHistory.js +5 -1
- package/package.json +1 -1
package/dist/useHistory.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { useEffect } from 'react';
|
1
|
+
import { useRef, useEffect } from 'react';
|
2
2
|
import { useHistory as useHistory$1 } from 'react-router-dom';
|
3
3
|
import { i as isQiankun } from './authority-118dc4b1.js';
|
4
4
|
import { WORKFLOW_HIDEFRAME_KEY } from './constants.js';
|
@@ -94,10 +94,14 @@ function useHistory(routeBasename) {
|
|
94
94
|
* @description 设置浏览器标题信息
|
95
95
|
*/
|
96
96
|
function useDocumentTitle(title) {
|
97
|
+
var oldTitle = useRef(document.title);
|
97
98
|
useEffect(function () {
|
98
99
|
if (title) {
|
99
100
|
document.title = title;
|
100
101
|
}
|
102
|
+
return function () {
|
103
|
+
document.title = oldTitle.current;
|
104
|
+
};
|
101
105
|
}, [title]);
|
102
106
|
}
|
103
107
|
function setFilterAuth() {
|