jsbox-cview 1.5.23 → 1.5.25

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.
@@ -121,11 +121,16 @@ export class TabBarController extends BaseController {
121
121
  }
122
122
 
123
123
  set index(num) {
124
+ if (this._props.index === num) return;
124
125
  this.cviews.tabbar.index = num;
125
126
  this.pages.forEach((n, i) => {
126
127
  n.view.hidden = i !== num;
127
128
  });
128
129
  this._props.index = num;
130
+ this._props.items
131
+ .find((item) => item.controller.status === 2)
132
+ ?.controller.disappear();
133
+ this._props.items[num].controller.appear();
129
134
  }
130
135
 
131
136
  get index() {
@@ -82,11 +82,17 @@ class TabBarController extends base_controller_1.BaseController {
82
82
  this.rootView.views = [this.cviews.pageContentView, this.cviews.tabbar];
83
83
  }
84
84
  set index(num) {
85
+ var _a;
86
+ if (this._props.index === num)
87
+ return;
85
88
  this.cviews.tabbar.index = num;
86
89
  this.pages.forEach((n, i) => {
87
90
  n.view.hidden = i !== num;
88
91
  });
89
92
  this._props.index = num;
93
+ (_a = this._props.items
94
+ .find((item) => item.controller.status === 2)) === null || _a === void 0 ? void 0 : _a.controller.disappear();
95
+ this._props.items[num].controller.appear();
90
96
  }
91
97
  get index() {
92
98
  return this._props.index || 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsbox-cview",
3
- "version": "1.5.23",
3
+ "version": "1.5.25",
4
4
  "description": "为 JSBox 设计的微型框架",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,6 +19,6 @@
19
19
  "devDependencies": {
20
20
  "@types/node": "^20.11.17",
21
21
  "browserify": "^17.0.0",
22
- "jsbox-types": "^1.0.41"
22
+ "jsbox-types": "^1.0.42"
23
23
  }
24
24
  }