@we-debug/miniprogram 0.49.2 → 0.50.0

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.
@@ -5,7 +5,17 @@
5
5
  <view class="w-mask__modal-header">
6
6
  <image class="w-mask__modal-logo" src="{{modal.logo}}" mode="aspectFit" lazy-load="false" binderror="" bindload=""></image>
7
7
  </view>
8
- <block wx:if="{{tableviews.length > 0}}">
8
+ <block wx:if="{{apiviews.length > 0}}">
9
+ <view style="height:{{modal.scrollHeight}}rpx; margin-top: 12px;">
10
+ <w-api-view id="w-api-view" config="{{apiviews[0]}}"/>
11
+ </view>
12
+ </block>
13
+ <block wx:elif="{{networkviews.length > 0}}">
14
+ <view style="height:{{modal.scrollHeight}}rpx; margin-top: 12px;">
15
+ <w-network-view id="w-network-view" config="{{networkviews[0]}}"/>
16
+ </view>
17
+ </block>
18
+ <block wx:elif="{{tableviews.length > 0}}">
9
19
  <view style="height:{{modal.scrollHeight}}rpx; margin-top: 12px;">
10
20
  <w-table-view config="{{tableviews[0]}}"/>
11
21
  </view>
@@ -81,7 +81,7 @@ Component({
81
81
  formattedData.forEach(item => {
82
82
  item.hidden = false;
83
83
  if (item.isOpening) {
84
- item.collapsed = level >= 0 && item.level >= level;
84
+ item.collapsed = item.hasChildren && level >= 0 && item.level >= level;
85
85
  }
86
86
  });
87
87
 
@@ -222,6 +222,7 @@ Component({
222
222
  isOpening: false,
223
223
  isClosing: true,
224
224
  isLast: true,
225
+ isEmpty: entries.length === 0,
225
226
  path: [...path],
226
227
  hidden: false
227
228
  });
@@ -12,7 +12,7 @@
12
12
  <view class="json-content">
13
13
  <block wx:for="{{formattedData}}" wx:key="index">
14
14
  <view
15
- class="json-item {{item.hidden ? 'hidden' : ''}} {{item.highlight ? 'highlight' : ''}}"
15
+ class="json-item {{item.hidden || item.isEmpty ? 'hidden' : ''}} {{item.highlight ? 'highlight' : ''}}"
16
16
  style="padding-left: {{item.level * 20}}px; transform: translateX(-{{scrollLeft}}px);"
17
17
  >
18
18
  <view class="content">
@@ -47,6 +47,7 @@
47
47
  <text wx:if="{{!item.inArray && item.key !== null}}" class="key">{{item.key}}: </text>
48
48
  <block wx:if="{{item.isOpening}}">
49
49
  <text class="bracket">{{item.isArray ? '[' : '{'}}{{item.collapsed ? '...' : ''}}</text>
50
+ <text wx:if="{{!item.hasChildren}}" class="bracket">{{item.isArray ? ']' : '}'}}</text>
50
51
  <text wx:if="{{editable}}" class="action add" catchtap="addItem" data-index="{{index}}">+</text>
51
52
  </block>
52
53
  <block wx:elif="{{!item.isClosing}}">
@@ -0,0 +1,14 @@
1
+ // 复用 Network 面板样式,保持两个面板视觉一致
2
+ @import './network-view.less';
3
+
4
+ .nv-initiator {
5
+ display: block;
6
+ padding: 2px 0;
7
+ font-size: 11px;
8
+ color: @nv-text-sub;
9
+ word-break: break-all;
10
+ }
11
+
12
+ .nv-error-text {
13
+ color: @nv-red;
14
+ }