@we-debug/miniprogram 0.36.0 → 0.37.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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.37.1](https://github.com/dlhandsome/we-debug/compare/v0.37.0...v0.37.1) (2024-11-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * 修复动态更新 group 逻辑 ([53885fb](https://github.com/dlhandsome/we-debug/commit/53885fb1e20fc014e95ded31ceb1f7b9ac7d61c2))
12
+
13
+
14
+
15
+
16
+
17
+ # [0.37.0](https://github.com/dlhandsome/we-debug/compare/v0.36.0...v0.37.0) (2024-11-25)
18
+
19
+
20
+ ### Features
21
+
22
+ * 支持动态更新 group ([ff4c1a2](https://github.com/dlhandsome/we-debug/commit/ff4c1a20944b5fa3113383e361271f85062c9a4f))
23
+
24
+
25
+
26
+
27
+
6
28
  # [0.36.0](https://github.com/dlhandsome/we-debug/compare/v0.35.0...v0.36.0) (2024-11-25)
7
29
 
8
30
 
@@ -6,6 +6,22 @@ const sys = store.sys.get();
6
6
  const currentGroupCache = Debug.createCache('__wedebug_miniprogram_group_actived_key__', '');
7
7
  const DEFAULT_GROUP = Debug.DEFAULT_GROUP;
8
8
 
9
+ const setGroup = () =>
10
+ store.group.getKeys((next, prev) => {
11
+ if (prev === '全部') {
12
+ return 1;
13
+ }
14
+ if (next === '全部') {
15
+ return -1;
16
+ }
17
+ if (prev === '未分类') {
18
+ return -1;
19
+ }
20
+ if (next === '未分类') {
21
+ return 1;
22
+ }
23
+ });
24
+
9
25
  Component({
10
26
  options: {
11
27
  multipleSlots: true
@@ -51,20 +67,7 @@ Component({
51
67
  },
52
68
  searchStr: '',
53
69
  group: {
54
- keys: store.group.getKeys((next, prev) => {
55
- if (prev === '全部') {
56
- return 1;
57
- }
58
- if (next === '全部') {
59
- return -1;
60
- }
61
- if (prev === '未分类') {
62
- return -1;
63
- }
64
- if (next === '未分类') {
65
- return 1;
66
- }
67
- }),
70
+ keys: setGroup(),
68
71
  actived: currentGroupCache.get() || DEFAULT_GROUP.ALL
69
72
  }
70
73
  },
@@ -72,6 +75,9 @@ Component({
72
75
  setSys() {
73
76
  this.setData({ sys: store.sys.get() });
74
77
  },
78
+ setGroups() {
79
+ this.setData({ 'group.keys': setGroup() });
80
+ },
75
81
  setRules() {
76
82
  this.setData({ rules: store.group.get(currentGroupCache.get() || DEFAULT_GROUP.ALL).get() });
77
83
  },
@@ -115,15 +121,18 @@ Component({
115
121
  addListeners() {
116
122
  store.event.on('rule:update', this.setRules.bind(this));
117
123
  store.event.on('badge:update', this.setBadges.bind(this));
124
+ store.event.on('group:update', this.setGroups.bind(this));
118
125
  },
119
126
  removeListeners() {
120
127
  store.event.off('rule:update', this.setRules.bind(this));
121
128
  store.event.off('badge:update', this.setBadges.bind(this));
129
+ store.event.off('group:update', this.setGroups.bind(this));
122
130
  }
123
131
  },
124
132
  lifetimes: {
125
133
  attached() {
126
134
  this.setSys();
135
+ this.setGroups();
127
136
  this.setRules();
128
137
  this.setBadges();
129
138
  this.addListeners();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@we-debug/miniprogram",
3
- "version": "0.36.0",
3
+ "version": "0.37.1",
4
4
  "description": "we-debug miniprogram component",
5
5
  "author": {
6
6
  "name": "dlhandsome"
@@ -26,10 +26,10 @@
26
26
  },
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@we-debug/core": "0.36.0"
29
+ "@we-debug/core": "0.37.0"
30
30
  },
31
31
  "readme": "ERROR: No README data found!",
32
32
  "_id": "@we-debug/core@0.3.5",
33
33
  "_commitid": "6c3f04b",
34
- "gitHead": "d259a05defcc5411fe82fa5d5894978e9b0a05da"
34
+ "gitHead": "f2401a65209b972c7ac893e57eb01167e04afad3"
35
35
  }