@we-debug/miniprogram 0.28.2 → 0.29.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.29.1](https://github.com/dlhandsome/we-debug/compare/v0.29.0...v0.29.1) (2023-12-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **runtime/miniprogram:** 修复分组缓存逻辑 ([8bd6f35](https://github.com/dlhandsome/we-debug/commit/8bd6f3575e983c6bd7b52e5a20d202a3463f2f71))
12
+
13
+
14
+
15
+
16
+
17
+ # [0.29.0](https://github.com/dlhandsome/we-debug/compare/v0.28.2...v0.29.0) (2023-12-22)
18
+
19
+
20
+ ### Features
21
+
22
+ * **runtime/miniprogram:** 支持缓存上一次点击的分组 ([ef5e8fc](https://github.com/dlhandsome/we-debug/commit/ef5e8fc55bb7f7ea007d1e39b3cf79de050b6035))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [0.28.2](https://github.com/dlhandsome/we-debug/compare/v0.28.1...v0.28.2) (2023-12-22)
7
29
 
8
30
 
@@ -2,6 +2,7 @@ import Debug from '@we-debug/core';
2
2
 
3
3
  const store = Debug.store;
4
4
  const sys = store.sys.get();
5
+ const currentGroupCache = Debug.createCache('__wedebug_miniprogram_group_actived_key__', '');
5
6
 
6
7
  Component({
7
8
  options: {
@@ -28,6 +29,14 @@ Component({
28
29
  if (v) {
29
30
  this.setData({ modal: v });
30
31
  }
32
+ },
33
+ 'config.group'(v) {
34
+ if (Array.isArray(v.keys)) {
35
+ this.setData({ 'group.keys': v.keys });
36
+ }
37
+ if (v.actived) {
38
+ this.setData({ 'group.actived': v.actived });
39
+ }
31
40
  }
32
41
  },
33
42
  data: {
@@ -39,8 +48,10 @@ Component({
39
48
  scrollHeight: ((sys.screenHeight * 3) / 5) * (750 / sys.screenWidth)
40
49
  },
41
50
  searchStr: '',
42
- group: store.group.getKeys(),
43
- currentGroup: '全部'
51
+ group: {
52
+ keys: store.group.getKeys(),
53
+ actived: currentGroupCache.get() || '全部'
54
+ }
44
55
  },
45
56
  methods: {
46
57
  setSys() {
@@ -80,9 +91,11 @@ Component({
80
91
  const rules = store.group.get(group).get();
81
92
 
82
93
  this.setData({
83
- currentGroup: group,
94
+ 'group.actived': group,
84
95
  rules
85
96
  });
97
+ // 设置当前分组 key 缓存
98
+ currentGroupCache.set(group);
86
99
  }
87
100
  },
88
101
  lifetimes: {
@@ -22,8 +22,8 @@
22
22
  <slot name="modal-body"></slot>
23
23
  </scroll-view>
24
24
  <scroll-view class="w-mask__modal-group" scroll-x="true">
25
- <view class="group-item {{item === currentGroup ? 'actived': ''}}" style=""
26
- wx:for="{{group}}"
25
+ <view class="group-item {{item === group.actived ? 'actived': ''}}" style=""
26
+ wx:for="{{group.keys}}"
27
27
  data-item="{{item}}"
28
28
  catch:tap="groupTapHandler">{{item}}</view>
29
29
  </scroll-view>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@we-debug/miniprogram",
3
- "version": "0.28.2",
3
+ "version": "0.29.1",
4
4
  "description": "we-debug miniprogram component",
5
5
  "author": {
6
6
  "name": "dlhandsome"
@@ -25,16 +25,16 @@
25
25
  },
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
- "@we-debug/core": "0.28.1",
29
- "@we-debug/plugin-error": "0.28.0",
30
- "@we-debug/plugin-launcher": "0.28.0",
31
- "@we-debug/plugin-network": "0.28.0",
32
- "@we-debug/plugin-router": "0.28.0",
33
- "@we-debug/plugin-ui-check": "0.28.0",
28
+ "@we-debug/core": "0.29.0",
29
+ "@we-debug/plugin-error": "0.29.0",
30
+ "@we-debug/plugin-launcher": "0.29.0",
31
+ "@we-debug/plugin-network": "0.29.0",
32
+ "@we-debug/plugin-router": "0.29.0",
33
+ "@we-debug/plugin-ui-check": "0.29.0",
34
34
  "deepmerge": "^4.2.2"
35
35
  },
36
36
  "readme": "ERROR: No README data found!",
37
37
  "_id": "@we-debug/core@0.3.5",
38
38
  "_commitid": "6c3f04b",
39
- "gitHead": "4b24bbe72aa1f426b03018103e78a87afc105908"
39
+ "gitHead": "03e9ad53ca12f7d42bd658e0b1c8ddc40d6f84be"
40
40
  }