parsec-hooks 1.0.1 → 1.0.4

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.
@@ -0,0 +1,2 @@
1
+ declare const _default: (pageName: string) => void;
2
+ export default _default;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _ali = require("remax/ali");
9
+
10
+ var _macro = require("remax/macro");
11
+
12
+ var _default = function _default(pageName) {
13
+ (0, _macro.usePageEvent)('onShow', function () {
14
+ (0, _ali.setNavigationBar)({
15
+ title: pageName
16
+ });
17
+ });
18
+ (0, _macro.usePageEvent)('onHide', function () {
19
+ (0, _ali.setNavigationBar)({
20
+ title: ''
21
+ });
22
+ });
23
+ };
24
+
25
+ exports.default = _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (pageName: string) => void;
2
+ export default _default;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _wechat = require("remax-rn/src/wechat");
9
+
10
+ var _macro = require("remax/macro");
11
+
12
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
+ // @ts-ignore
14
+ var _default = function _default(pageName) {
15
+ (0, _macro.usePageEvent)('onShow', function () {
16
+ (0, _wechat.setNavigationBarTitle)({
17
+ title: pageName
18
+ });
19
+ });
20
+ (0, _macro.usePageEvent)('onHide', function () {
21
+ (0, _wechat.setNavigationBarTitle)({
22
+ title: ''
23
+ });
24
+ });
25
+ };
26
+
27
+ exports.default = _default;
@@ -5,16 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _react = require("react");
9
-
10
8
  var _wechat = require("remax/wechat");
11
9
 
10
+ var _macro = require("remax/macro");
11
+
12
12
  var _default = function _default(pageName) {
13
- (0, _react.useEffect)(function () {
13
+ (0, _macro.usePageEvent)('onShow', function () {
14
14
  (0, _wechat.setNavigationBarTitle)({
15
15
  title: pageName
16
16
  });
17
- }, [pageName]);
17
+ });
18
+ (0, _macro.usePageEvent)('onHide', function () {
19
+ (0, _wechat.setNavigationBarTitle)({
20
+ title: ''
21
+ });
22
+ });
18
23
  };
19
24
 
20
25
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parsec-hooks",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "秒差距前端常用的hooks工具",
5
5
  "author": "mushan0x0",
6
6
  "license": "MIT",