vite-uni-dev-tool 0.0.12 → 0.0.14
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/dist/const.d.ts +133 -0
- package/dist/const.d.ts.map +1 -0
- package/dist/const.js +36 -0
- package/dist/core.d.ts +52 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +80 -0
- package/dist/devConsole/index.d.ts +169 -0
- package/dist/devConsole/index.d.ts.map +1 -0
- package/dist/devConsole/index.js +270 -0
- package/dist/devEvent/index.d.ts +286 -0
- package/dist/devEvent/index.d.ts.map +1 -0
- package/dist/devEvent/index.js +435 -0
- package/dist/devEventBus/index.d.ts +42 -0
- package/dist/devEventBus/index.d.ts.map +1 -0
- package/dist/devEventBus/index.js +70 -0
- package/dist/devIntercept/index.d.ts +119 -0
- package/dist/devIntercept/index.d.ts.map +1 -0
- package/dist/devIntercept/index.js +582 -0
- package/dist/devRunJS/index.d.ts +67 -0
- package/dist/devRunJS/index.d.ts.map +1 -0
- package/dist/devStore/index.d.ts +178 -0
- package/dist/devStore/index.d.ts.map +1 -0
- package/dist/devStore/index.js +395 -0
- package/dist/devToolInfo/index.d.ts +17 -0
- package/dist/devToolInfo/index.d.ts.map +1 -0
- package/dist/devToolInfo/index.js +15 -0
- package/{dev → dist}/plugins/uniDevTool/uniDevTool.d.ts +7 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -0
- package/dist/plugins/uniDevTool/uniDevTool.js +35 -0
- package/{dev → dist}/plugins/utils/index.d.ts +3 -0
- package/{dev → dist}/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +1 -0
- package/dist/type.d.ts +264 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/utils/array.d.ts +2 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +12 -0
- package/dist/utils/date.d.ts +19 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +40 -0
- package/dist/utils/file.d.ts +11 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +87 -0
- package/dist/utils/function.d.ts +28 -0
- package/dist/utils/function.d.ts.map +1 -0
- package/dist/utils/function.js +46 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +55 -0
- package/dist/utils/ip.d.ts +5 -0
- package/dist/utils/ip.d.ts.map +1 -0
- package/dist/utils/ip.js +21 -0
- package/dist/utils/language.d.ts +29 -0
- package/dist/utils/language.d.ts.map +1 -0
- package/dist/utils/language.js +50 -0
- package/dist/utils/object.d.ts +49 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.js +118 -0
- package/dist/utils/page.d.ts +7 -0
- package/dist/utils/page.d.ts.map +1 -0
- package/dist/utils/page.js +7 -0
- package/dist/utils/platform.d.ts +4 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +14 -0
- package/dist/utils/string.d.ts +45 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +88 -0
- package/dist/utils/utils.d.ts +16 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/v2/AppInfo/index.vue +41 -0
- package/dist/v2/AutoSizer/index.vue +189 -0
- package/dist/v2/AutoSizer/index1.vue +193 -0
- package/dist/v2/AutoSizer/utils.d.ts +5 -0
- package/dist/v2/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v2/CaptureScreen/index.vue +78 -0
- package/dist/v2/CloseButton/index.vue +32 -0
- package/dist/v2/Connection/index.vue +94 -0
- package/dist/v2/ConsoleList/ConsoleItem.vue +235 -0
- package/dist/v2/ConsoleList/RunJSInput.vue +243 -0
- package/dist/v2/ConsoleList/index.vue +164 -0
- package/dist/v2/ConsoleList/staticTips.js +1144 -0
- package/dist/v2/DevTool/index.vue +162 -0
- package/dist/v2/DevToolButton/index.vue +228 -0
- package/dist/v2/DevToolTitle/index.vue +28 -0
- package/dist/v2/DevToolWindow/index.vue +1051 -0
- package/dist/v2/DeviceInfo/index.vue +48 -0
- package/dist/v2/Empty/index.vue +40 -0
- package/dist/v2/FilterInput/index.vue +100 -0
- package/dist/v2/JsonPretty/components/Brackets/index.vue +30 -0
- package/dist/v2/JsonPretty/components/Carets/index.vue +65 -0
- package/dist/v2/JsonPretty/components/CheckController/index.vue +127 -0
- package/dist/v2/JsonPretty/components/TreeNode/index.vue +417 -0
- package/dist/v2/JsonPretty/hooks/useClipboard.d.ts +4 -0
- package/dist/v2/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
- package/dist/v2/JsonPretty/hooks/useError.d.ts +8 -0
- package/dist/v2/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v2/JsonPretty/index.vue +531 -0
- package/dist/v2/JsonPretty/type.d.ts +93 -0
- package/dist/v2/JsonPretty/type.d.ts.map +1 -0
- package/dist/v2/JsonPretty/utils/index.js +211 -0
- package/dist/v2/NetworkList/NetworkDetail.vue +215 -0
- package/dist/v2/NetworkList/NetworkItem.vue +135 -0
- package/dist/v2/NetworkList/index.vue +148 -0
- package/dist/v2/PiniaList/index.vue +79 -0
- package/dist/v2/RouteList/index.vue +137 -0
- package/dist/v2/SettingList/index.vue +318 -0
- package/dist/v2/SourceCode/index.vue +237 -0
- package/dist/v2/StorageList/index.vue +165 -0
- package/dist/v2/SystemInfo/index.vue +49 -0
- package/dist/v2/Tabs/index.vue +127 -0
- package/dist/v2/Tag/index.vue +91 -0
- package/dist/v2/UniEvent/UniEventItem.vue +157 -0
- package/dist/v2/UniEvent/index.vue +127 -0
- package/dist/v2/UploadList/UploadDetail.vue +204 -0
- package/dist/v2/UploadList/UploadItem.vue +134 -0
- package/dist/v2/UploadList/index.vue +143 -0
- package/dist/v2/VirtualList/index.vue +140 -0
- package/dist/v2/VirtualListPro/AutoSize.vue +50 -0
- package/dist/v2/VirtualListPro/index.vue +255 -0
- package/dist/v2/VuexList/index.vue +80 -0
- package/dist/v2/WebSocket/WebSocketItem.vue +129 -0
- package/dist/v2/WebSocket/WebSocketList.vue +183 -0
- package/dist/v2/WebSocket/index.vue +155 -0
- package/dist/v2/WindowInfo/index.vue +49 -0
- package/{dev/components → dist/v3}/AppInfo/index.vue +0 -1
- package/dist/v3/AutoSizer/utils.d.ts +5 -0
- package/dist/v3/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v3/AutoSizer/utils.ts +49 -0
- package/{dev/components → dist/v3}/CloseButton/index.vue +5 -2
- package/{dev/components → dist/v3}/ConsoleList/ConsoleItem.vue +10 -9
- package/{dev/components → dist/v3}/ConsoleList/RunJSInput.vue +5 -2
- package/dist/v3/ConsoleList/staticTips.d.ts +13 -0
- package/dist/v3/ConsoleList/staticTips.d.ts.map +1 -0
- package/{dev/components → dist/v3}/DevTool/index.vue +33 -4
- package/{dev/components → dist/v3}/DevToolWindow/index.vue +67 -4
- package/dist/v3/Empty/empty.png +0 -0
- package/{dev/components → dist/v3}/FilterInput/index.vue +5 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +4 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.ts +21 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts +8 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v3/JsonPretty/hooks/useError.ts +21 -0
- package/{dev/components → dist/v3}/JsonPretty/index.vue +10 -10
- package/dist/v3/JsonPretty/type.d.ts +93 -0
- package/dist/v3/JsonPretty/type.d.ts.map +1 -0
- package/dist/v3/JsonPretty/type.ts +125 -0
- package/dist/v3/JsonPretty/utils/index.d.ts +10 -0
- package/dist/v3/JsonPretty/utils/index.d.ts.map +1 -0
- package/{dev/components → dist/v3}/NetworkList/NetworkDetail.vue +2 -2
- package/{dev/components → dist/v3}/NetworkList/NetworkItem.vue +2 -1
- package/dist/v3/RunJS/index.vue +128 -0
- package/{dev/components → dist/v3}/SettingList/index.vue +128 -37
- package/{dev/components → dist/v3}/SourceCode/index.vue +2 -2
- package/{dev/components → dist/v3}/Tag/index.vue +4 -4
- package/{dev/components → dist/v3}/UploadList/UploadDetail.vue +3 -15
- package/{dev/components → dist/v3}/UploadList/UploadItem.vue +1 -1
- package/dist/v3/VirtualListPro/readme.md +40 -0
- package/{dev/components → dist/v3}/WebSocket/WebSocketItem.vue +1 -1
- package/{dev/components → dist/v3}/WebSocket/WebSocketList.vue +3 -15
- package/package.json +5 -5
- package/dev/components/Button/index.vue +0 -34
- package/dev/components/Checkbox/index.vue +0 -40
- package/dev/components/Code/index.vue +0 -230
- package/dev/components/ConsoleList/Code.vue +0 -227
- package/dev/const.ts +0 -164
- package/dev/core.ts +0 -118
- package/dev/devConsole/index.ts +0 -350
- package/dev/devEvent/index.ts +0 -810
- package/dev/devEventBus/index.ts +0 -94
- package/dev/devIntercept/index.ts +0 -745
- package/dev/devRunJS/index.ts +0 -170
- package/dev/devStore/index.ts +0 -732
- package/dev/devToolInfo/index.ts +0 -26
- package/dev/plugins/uniDevTool/uniDevTool.d.ts.map +0 -1
- package/dev/plugins/uniDevTool/uniDevTool.js +0 -36
- package/dev/plugins/utils/index.js +0 -1
- package/dev/shims-uni.d.ts +0 -43
- package/dev/type.ts +0 -291
- package/dev/utils/array.ts +0 -15
- package/dev/utils/date.ts +0 -75
- package/dev/utils/file.ts +0 -121
- package/dev/utils/function.ts +0 -192
- package/dev/utils/index.d.ts +0 -6
- package/dev/utils/index.ts +0 -51
- package/dev/utils/ip.ts +0 -79
- package/dev/utils/language.ts +0 -77
- package/dev/utils/object.ts +0 -306
- package/dev/utils/page.ts +0 -13
- package/dev/utils/platform.ts +0 -14
- package/dev/utils/string.ts +0 -133
- package/dev/utils/utils.ts +0 -198
- /package/{dev → dist}/index.d.ts +0 -0
- /package/{dev → dist}/index.d.ts.map +0 -0
- /package/{dev → dist}/index.js +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.js +0 -0
- /package/{dev/components → dist/v2}/AutoSizer/utils.ts +0 -0
- /package/{dev/components → dist/v2}/Empty/empty.png +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/hooks/useClipboard.ts +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/hooks/useError.ts +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/type.ts +0 -0
- /package/{dev/components → dist/v2}/RunJS/index.vue +0 -0
- /package/{dev/components → dist/v2}/VirtualListPro/readme.md +0 -0
- /package/{dev/components → dist/v3}/AutoSizer/index.vue +0 -0
- /package/{dev/components → dist/v3}/AutoSizer/index1.vue +0 -0
- /package/{dev/components → dist/v3}/CaptureScreen/index.vue +0 -0
- /package/{dev/components → dist/v3}/Connection/index.vue +0 -0
- /package/{dev/components → dist/v3}/ConsoleList/index.vue +0 -0
- /package/{dev/components → dist/v3}/ConsoleList/staticTips.ts +0 -0
- /package/{dev/components → dist/v3}/DevToolButton/index.vue +0 -0
- /package/{dev/components → dist/v3}/DevToolTitle/index.vue +0 -0
- /package/{dev/components → dist/v3}/DeviceInfo/index.vue +0 -0
- /package/{dev/components → dist/v3}/Empty/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/Brackets/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/Carets/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/CheckController/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/TreeNode/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/utils/index.ts +0 -0
- /package/{dev/components → dist/v3}/NetworkList/index.vue +0 -0
- /package/{dev/components → dist/v3}/PiniaList/index.vue +0 -0
- /package/{dev/components → dist/v3}/RouteList/index.vue +0 -0
- /package/{dev/components → dist/v3}/StorageList/index.vue +0 -0
- /package/{dev/components → dist/v3}/SystemInfo/index.vue +0 -0
- /package/{dev/components → dist/v3}/Tabs/index.vue +0 -0
- /package/{dev/components → dist/v3}/UniEvent/UniEventItem.vue +0 -0
- /package/{dev/components → dist/v3}/UniEvent/index.vue +0 -0
- /package/{dev/components → dist/v3}/UploadList/index.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualList/index.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualListPro/AutoSize.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualListPro/index.vue +0 -0
- /package/{dev/components → dist/v3}/VuexList/index.vue +0 -0
- /package/{dev/components → dist/v3}/WebSocket/index.vue +0 -0
- /package/{dev/components → dist/v3}/WindowInfo/index.vue +0 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="run-js">
|
|
3
|
+
<view class="run-js-control">
|
|
4
|
+
<FilterInput
|
|
5
|
+
:modelValue="modelValue"
|
|
6
|
+
placeholder="查询"
|
|
7
|
+
@search="emit('search', $event)"
|
|
8
|
+
@update:modelValue="emit('update:modelValue', $event)"
|
|
9
|
+
/>
|
|
10
|
+
<Tag mode="clear" @click="emit('clear')">清空</Tag>
|
|
11
|
+
</view>
|
|
12
|
+
<view class="run-js-list">
|
|
13
|
+
<view class="run-js-item" v-for="item in runJSList">
|
|
14
|
+
<view :class="`run-js-item-icon run-js-item-${item.mode}`"></view>
|
|
15
|
+
<view class="run-js-item-duration" v-if="item.mode === 'output'">
|
|
16
|
+
{{ item.duration }}ms
|
|
17
|
+
</view>
|
|
18
|
+
<view
|
|
19
|
+
class="run-js-item-content"
|
|
20
|
+
v-html="item.mode === 'input' ? item.code : item.result"
|
|
21
|
+
>
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
<view class="run-js-item">
|
|
25
|
+
<view class="run-js-item-icon run-js-item-input"> </view>
|
|
26
|
+
|
|
27
|
+
<input v-model="code" class="run-js-input" @confirm="onConfirm" />
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
</view>
|
|
31
|
+
</template>
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import { ref } from 'vue';
|
|
34
|
+
import type { DevTool } from '../../type';
|
|
35
|
+
import FilterInput from '../FilterInput/index.vue';
|
|
36
|
+
import Tag from '../Tag/index.vue';
|
|
37
|
+
|
|
38
|
+
defineProps<{ runJSList: DevTool.RunJSItem[]; modelValue: string }>();
|
|
39
|
+
|
|
40
|
+
const emit = defineEmits<{
|
|
41
|
+
(e: 'search', value: string): void;
|
|
42
|
+
(e: 'update:modelValue', value: string): void;
|
|
43
|
+
(e: 'clear'): void;
|
|
44
|
+
(e: 'run', value: string): void;
|
|
45
|
+
}>();
|
|
46
|
+
const code = ref('');
|
|
47
|
+
function onConfirm() {
|
|
48
|
+
const value = code.value;
|
|
49
|
+
if (!value) return;
|
|
50
|
+
code.value = '';
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
emit('run', value);
|
|
53
|
+
}, 100);
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
<style scoped>
|
|
57
|
+
.run-js {
|
|
58
|
+
height: 100%;
|
|
59
|
+
font-size: var(--dev-tool-base-font-size);
|
|
60
|
+
}
|
|
61
|
+
.run-js-control {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
gap: 8px;
|
|
66
|
+
padding: 0 16px;
|
|
67
|
+
height: 32px;
|
|
68
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.run-js-list {
|
|
73
|
+
height: calc(100% - 32px);
|
|
74
|
+
overflow: auto;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.run-js-item {
|
|
78
|
+
position: relative;
|
|
79
|
+
display: flex;
|
|
80
|
+
padding: 0 16px;
|
|
81
|
+
min-height: 28px;
|
|
82
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.run-js-item-icon {
|
|
87
|
+
width: 8px;
|
|
88
|
+
height: 8px;
|
|
89
|
+
border: 1px solid #000;
|
|
90
|
+
border-bottom-color: transparent;
|
|
91
|
+
border-left-color: transparent;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.run-js-item-input {
|
|
96
|
+
margin: 10px 0 10px -4px;
|
|
97
|
+
transform: rotate(45deg);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.run-js-item-output {
|
|
101
|
+
margin: 10px -4px 10px 0px;
|
|
102
|
+
transform: rotate(-135deg);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.run-js-item-content {
|
|
106
|
+
margin-left: 16px;
|
|
107
|
+
min-height: 28px;
|
|
108
|
+
line-height: 28px;
|
|
109
|
+
white-space: pre-line;
|
|
110
|
+
word-break: break-all;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.run-js-input {
|
|
114
|
+
margin: 1px 0 1px 16px;
|
|
115
|
+
min-height: 26px;
|
|
116
|
+
width: 100%;
|
|
117
|
+
border: 1px solid transparent;
|
|
118
|
+
font-size: var(--dev-tool-base-font-size);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.run-js-item-duration {
|
|
122
|
+
position: absolute;
|
|
123
|
+
top: 2px;
|
|
124
|
+
right: 16px;
|
|
125
|
+
height: 24px;
|
|
126
|
+
line-height: 24px;
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="setting-content">
|
|
3
3
|
<view class="setting-item">
|
|
4
|
-
<DevToolTitle>DevTool</DevToolTitle>
|
|
4
|
+
<DevToolTitle>DevTool(v0.0.12-vue3)</DevToolTitle>
|
|
5
5
|
<view class="setting-item-content">
|
|
6
6
|
<view class="setting-row">
|
|
7
7
|
<view>显示调试按钮:</view>
|
|
8
|
-
<
|
|
9
|
-
:
|
|
10
|
-
|
|
8
|
+
<checkbox
|
|
9
|
+
:checked="devToolVisible"
|
|
10
|
+
color="#9254de"
|
|
11
|
+
style="transform: scale(0.8)"
|
|
12
|
+
@click="onChangeShowDevButton"
|
|
11
13
|
/>
|
|
12
14
|
</view>
|
|
13
15
|
<view class="setting-tips"> 取消后将不在展示调试按钮 </view>
|
|
@@ -16,9 +18,9 @@
|
|
|
16
18
|
</view>
|
|
17
19
|
|
|
18
20
|
<view class="setting-tips">点击后将会重启调试器</view>
|
|
19
|
-
<
|
|
21
|
+
<button class="setting-button" @click="onRestartDevTool(true)">
|
|
20
22
|
重启调试器
|
|
21
|
-
</
|
|
23
|
+
</button>
|
|
22
24
|
|
|
23
25
|
<view class="setting-row">
|
|
24
26
|
<view>销毁调试器:</view>
|
|
@@ -28,17 +30,17 @@
|
|
|
28
30
|
点击后将会销毁调试器,销毁后不再接收调试信息,需要通过 createDevTool()
|
|
29
31
|
重新创建
|
|
30
32
|
</view>
|
|
31
|
-
<
|
|
33
|
+
<button class="setting-button" @click="onDestructionDevTool">
|
|
32
34
|
销毁调试器
|
|
33
|
-
</
|
|
35
|
+
</button>
|
|
34
36
|
|
|
35
37
|
<view class="setting-row">
|
|
36
38
|
<view>重启APP:</view>
|
|
37
39
|
</view>
|
|
38
40
|
<view class="setting-tips">点击后将会重启APP</view>
|
|
39
|
-
<
|
|
41
|
+
<button class="setting-button" @click="onRestartApp(true)">
|
|
40
42
|
重启APP
|
|
41
|
-
</
|
|
43
|
+
</button>
|
|
42
44
|
<view class="setting-row">
|
|
43
45
|
<view>占用存储空间:{{ sizeFormat }}</view>
|
|
44
46
|
</view>
|
|
@@ -46,9 +48,28 @@
|
|
|
46
48
|
当前所有信息占用的存储空间,只会清除 Console, Network, Upload,
|
|
47
49
|
Websocket, UniEvent
|
|
48
50
|
</view>
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
<button class="setting-button" @click="onClearCache">清除缓存</button>
|
|
52
|
+
</view>
|
|
53
|
+
</view>
|
|
54
|
+
<view class="setting-item">
|
|
55
|
+
<DevToolTitle>主题</DevToolTitle>
|
|
56
|
+
<view class="setting-item-content">
|
|
57
|
+
<view class="setting-theme">
|
|
58
|
+
<view
|
|
59
|
+
class="setting-item-theme setting-theme-light"
|
|
60
|
+
:class="{
|
|
61
|
+
'setting-theme-active': theme === 'light',
|
|
62
|
+
}"
|
|
63
|
+
@click="emit('changeTheme', 'light')"
|
|
64
|
+
></view>
|
|
65
|
+
<view
|
|
66
|
+
class="setting-item-theme setting-theme-dark"
|
|
67
|
+
:class="{
|
|
68
|
+
'setting-theme-active': theme === 'dart',
|
|
69
|
+
}"
|
|
70
|
+
@click="emit('changeTheme', 'dart')"
|
|
71
|
+
></view>
|
|
72
|
+
</view>
|
|
52
73
|
</view>
|
|
53
74
|
</view>
|
|
54
75
|
<view class="setting-item">
|
|
@@ -56,75 +77,101 @@
|
|
|
56
77
|
<view class="setting-item-content">
|
|
57
78
|
<view class="setting-row">
|
|
58
79
|
<view>导出当前日志信息:</view>
|
|
59
|
-
<
|
|
80
|
+
<checkbox
|
|
81
|
+
:checked="setting.exportLog"
|
|
82
|
+
color="#9254de"
|
|
83
|
+
style="transform: scale(0.8)"
|
|
84
|
+
@click="setting.exportLog = !setting.exportLog"
|
|
85
|
+
/>
|
|
60
86
|
</view>
|
|
61
87
|
<view class="setting-tips">勾选后将会导出当前的Log</view>
|
|
62
88
|
<view class="setting-row">
|
|
63
89
|
<view>导出当前网络信息:</view>
|
|
64
|
-
<
|
|
90
|
+
<checkbox
|
|
91
|
+
:checked="setting.exportNetwork"
|
|
92
|
+
color="#9254de"
|
|
93
|
+
style="transform: scale(0.8)"
|
|
94
|
+
@click="setting.exportNetwork = !setting.exportNetwork"
|
|
95
|
+
/>
|
|
65
96
|
</view>
|
|
66
97
|
<view class="setting-tips">勾选后将会导出当前的Network</view>
|
|
67
98
|
<view class="setting-row">
|
|
68
99
|
<view>导出当前上传信息:</view>
|
|
69
|
-
<
|
|
100
|
+
<checkbox
|
|
101
|
+
:checked="setting.exportUpload"
|
|
102
|
+
color="#9254de"
|
|
103
|
+
style="transform: scale(0.8)"
|
|
104
|
+
@click="setting.exportUpload = !setting.exportUpload"
|
|
105
|
+
/>
|
|
70
106
|
</view>
|
|
71
107
|
<view class="setting-tips">勾选后将会导出当前的Upload</view>
|
|
72
108
|
<view class="setting-row">
|
|
73
109
|
<view>导出当前套接字信息:</view>
|
|
74
|
-
<
|
|
110
|
+
<checkbox
|
|
111
|
+
:checked="setting.exportWebsocket"
|
|
112
|
+
color="#9254de"
|
|
113
|
+
style="transform: scale(0.8)"
|
|
114
|
+
@click="setting.exportWebsocket = !setting.exportWebsocket"
|
|
115
|
+
/>
|
|
75
116
|
</view>
|
|
76
117
|
<view class="setting-tips">勾选后将会导出当前的Websocket</view>
|
|
77
118
|
<view class="setting-row">
|
|
78
119
|
<view>导出当前缓存信息:</view>
|
|
79
|
-
<
|
|
120
|
+
<checkbox
|
|
121
|
+
:checked="setting.exportStorage"
|
|
122
|
+
color="#9254de"
|
|
123
|
+
style="transform: scale(0.8)"
|
|
124
|
+
@click="setting.exportStorage = !setting.exportStorage"
|
|
125
|
+
/>
|
|
80
126
|
</view>
|
|
81
127
|
<view class="setting-tips">
|
|
82
128
|
勾选后将会导出当前的Storage, Vuex, Pinia
|
|
83
129
|
</view>
|
|
84
130
|
<view class="setting-row">
|
|
85
131
|
<view>导出当前窗口信息:</view>
|
|
86
|
-
<
|
|
132
|
+
<checkbox
|
|
133
|
+
:checked="setting.exportWindow"
|
|
134
|
+
color="#9254de"
|
|
135
|
+
style="transform: scale(0.8)"
|
|
136
|
+
@click="setting.exportWindow = !setting.exportWindow"
|
|
137
|
+
/>
|
|
87
138
|
</view>
|
|
88
139
|
<view class="setting-tips">勾选后将会导出当前的Window</view>
|
|
89
140
|
|
|
90
141
|
<view class="setting-row">
|
|
91
142
|
<view>导出当前设备信息:</view>
|
|
92
|
-
<
|
|
143
|
+
<checkbox
|
|
144
|
+
:checked="setting.exportDevice"
|
|
145
|
+
color="#9254de"
|
|
146
|
+
style="transform: scale(0.8)"
|
|
147
|
+
@click="setting.exportDevice = !setting.exportDevice"
|
|
148
|
+
/>
|
|
93
149
|
</view>
|
|
94
150
|
<view class="setting-tips">勾选后将会导出当前的Device</view>
|
|
95
151
|
|
|
96
152
|
<view class="setting-row">
|
|
97
153
|
<view>导出当前系统信息:</view>
|
|
98
|
-
<
|
|
154
|
+
<checkbox
|
|
155
|
+
:checked="setting.exportSystem"
|
|
156
|
+
color="#9254de"
|
|
157
|
+
style="transform: scale(0.8)"
|
|
158
|
+
@click="setting.exportSystem = !setting.exportSystem"
|
|
159
|
+
/>
|
|
99
160
|
</view>
|
|
100
161
|
<view class="setting-tips">勾选后将会导出当前的System</view>
|
|
101
162
|
|
|
102
|
-
<
|
|
163
|
+
<button class="setting-button" @click="onExportLog">导出</button>
|
|
103
164
|
</view>
|
|
104
165
|
</view>
|
|
105
|
-
|
|
106
|
-
<!--
|
|
107
|
-
<view class="setting-item">
|
|
108
|
-
<view class="setting-item-title">截图</view>
|
|
109
|
-
<DButton
|
|
110
|
-
class="setting-button"
|
|
111
|
-
|
|
112
|
-
@click="onScreenshot"
|
|
113
|
-
>
|
|
114
|
-
截图当前路由
|
|
115
|
-
</DButton>
|
|
116
|
-
</view>
|
|
117
|
-
-->
|
|
118
166
|
</view>
|
|
119
167
|
</template>
|
|
120
168
|
<script lang="ts" setup>
|
|
121
169
|
import { reactive } from 'vue';
|
|
122
|
-
import Checkbox from '../Checkbox/index.vue';
|
|
123
|
-
import DButton from '../Button/index.vue';
|
|
124
170
|
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
125
171
|
defineProps<{
|
|
126
172
|
devToolVisible?: boolean;
|
|
127
173
|
sizeFormat?: string;
|
|
174
|
+
theme?: string;
|
|
128
175
|
}>();
|
|
129
176
|
const setting = reactive({
|
|
130
177
|
restartDevTool: false,
|
|
@@ -158,6 +205,7 @@ const emit = defineEmits<{
|
|
|
158
205
|
(e: 'screenshot'): void;
|
|
159
206
|
(e: 'clearCache'): void;
|
|
160
207
|
(e: 'destroyDevTool'): void;
|
|
208
|
+
(e: 'changeTheme', value: string): void;
|
|
161
209
|
}>();
|
|
162
210
|
|
|
163
211
|
function onChangeShowDevButton(show: boolean) {
|
|
@@ -219,4 +267,47 @@ function onClearCache() {
|
|
|
219
267
|
font-size: var(--dev-tool-tips-font-size);
|
|
220
268
|
margin-bottom: 8px;
|
|
221
269
|
}
|
|
270
|
+
|
|
271
|
+
.setting-button {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
width: 100%;
|
|
276
|
+
height: 32px;
|
|
277
|
+
border-radius: 4px;
|
|
278
|
+
color: #fff;
|
|
279
|
+
outline: none;
|
|
280
|
+
border: 1px solid transparent;
|
|
281
|
+
background-color: var(--dev-tool-main-color);
|
|
282
|
+
transform: all 0.3s;
|
|
283
|
+
font-size: var(--dev-tool-base-font-size);
|
|
284
|
+
padding: 0;
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.setting-theme {
|
|
289
|
+
display: flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
gap: 16px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.setting-item-theme {
|
|
295
|
+
margin-top: 16px;
|
|
296
|
+
width: 30px;
|
|
297
|
+
height: 30px;
|
|
298
|
+
|
|
299
|
+
border-radius: 4px;
|
|
300
|
+
border: 1px solid #fff;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.setting-theme-light {
|
|
304
|
+
background-color: #fff;
|
|
305
|
+
}
|
|
306
|
+
.setting-theme-dark {
|
|
307
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.setting-theme-active {
|
|
311
|
+
border: 1px solid var(--dev-tool-main-color);
|
|
312
|
+
}
|
|
222
313
|
</style>
|
|
@@ -180,9 +180,9 @@ onMounted(() => {
|
|
|
180
180
|
left: 0;
|
|
181
181
|
padding: 0 16px;
|
|
182
182
|
|
|
183
|
-
background-color:
|
|
183
|
+
background-color: var(--dev-tool-bg2-color);
|
|
184
184
|
box-sizing: border-box;
|
|
185
|
-
color:
|
|
185
|
+
color: var(--dev-tool-text-color);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
.dev-tool-code-control {
|
|
@@ -32,7 +32,7 @@ function onClick(event: MouseEvent) {
|
|
|
32
32
|
padding: 0 4px;
|
|
33
33
|
width: min-content;
|
|
34
34
|
height: 24px;
|
|
35
|
-
color:
|
|
35
|
+
color: var(--dev-tool-text-color);
|
|
36
36
|
border-radius: 4px;
|
|
37
37
|
white-space: nowrap;
|
|
38
38
|
box-sizing: border-box;
|
|
@@ -42,8 +42,8 @@ function onClick(event: MouseEvent) {
|
|
|
42
42
|
}
|
|
43
43
|
.tag-log {
|
|
44
44
|
color: #000;
|
|
45
|
-
background-color: var(--dev-tool-
|
|
46
|
-
border: 1px solid var(--dev-tool-
|
|
45
|
+
background-color: var(--dev-tool-log-color);
|
|
46
|
+
border: 1px solid var(--dev-tool-log-color);
|
|
47
47
|
}
|
|
48
48
|
.tag-info {
|
|
49
49
|
color: #000;
|
|
@@ -78,7 +78,7 @@ function onClick(event: MouseEvent) {
|
|
|
78
78
|
border: 1px solid #0958d9;
|
|
79
79
|
}
|
|
80
80
|
.tag-all {
|
|
81
|
-
color:
|
|
81
|
+
color: var(--dev-tool-text-color);
|
|
82
82
|
border: 1px solid #000;
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -160,8 +160,9 @@ function onClose() {
|
|
|
160
160
|
top: 0;
|
|
161
161
|
left: 0;
|
|
162
162
|
padding: 0 16px;
|
|
163
|
-
background-color:
|
|
163
|
+
background-color: var(--dev-tool-bg2-color);
|
|
164
164
|
box-sizing: border-box;
|
|
165
|
+
transform: background-color 0.3s;
|
|
165
166
|
}
|
|
166
167
|
.upload-detail .upload-detail-control {
|
|
167
168
|
display: flex;
|
|
@@ -173,19 +174,6 @@ function onClose() {
|
|
|
173
174
|
box-sizing: border-box;
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
.upload-detail .upload-detail-close {
|
|
177
|
-
flex-shrink: 0;
|
|
178
|
-
display: flex;
|
|
179
|
-
align-items: center;
|
|
180
|
-
justify-content: center;
|
|
181
|
-
width: 24px;
|
|
182
|
-
height: 24px;
|
|
183
|
-
margin-left: auto;
|
|
184
|
-
border-radius: 50%;
|
|
185
|
-
border: 1px solid #000;
|
|
186
|
-
box-sizing: border-box;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
177
|
.upload-detail .upload-detail-header .net-detail-item {
|
|
190
178
|
display: flex;
|
|
191
179
|
align-items: center;
|
|
@@ -195,7 +183,7 @@ function onClose() {
|
|
|
195
183
|
.upload-detail .upload-detail-header .net-detail-item > view:first-child {
|
|
196
184
|
white-space: nowrap;
|
|
197
185
|
margin-right: 8px;
|
|
198
|
-
color:
|
|
186
|
+
color: var(--dev-tool-info-color);
|
|
199
187
|
}
|
|
200
188
|
.upload-detail .upload-detail-payload {
|
|
201
189
|
word-break: break-all;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# VirtualListAutoHeight
|
|
2
|
+
|
|
3
|
+
自适应高度虚拟列表
|
|
4
|
+
|
|
5
|
+
## 核心
|
|
6
|
+
|
|
7
|
+
- 初始加载两页数据
|
|
8
|
+
- 初始获取当前加载的渲染列表的数据 ,得到第一页高度
|
|
9
|
+
- scroll-view
|
|
10
|
+
- 滚动到底部(顶部)current + 1
|
|
11
|
+
- createIntersectionObserver
|
|
12
|
+
- 辅助反向监听节点是否出现再可视范围之内
|
|
13
|
+
- current - 1
|
|
14
|
+
- 数据分页之后确定每页高度,采用合并高度支撑滚动条
|
|
15
|
+
- 合并高度计算逻辑: 第一页高度 = 第一页高度
|
|
16
|
+
- 后续页高度 = 前面所有高度 + 当前页高度.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
一页两条
|
|
20
|
+
|
|
21
|
+
pageSize = 2
|
|
22
|
+
current = 2
|
|
23
|
+
visibleDate = [3,4,5,6]
|
|
24
|
+
|
|
25
|
+
visibleDate.splice(1*2, visibleDate.length - 1*2)
|
|
26
|
+
|
|
27
|
+
const start = cur
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
1
|
|
31
|
+
2
|
|
32
|
+
|
|
33
|
+
3
|
|
34
|
+
4
|
|
35
|
+
|
|
36
|
+
5
|
|
37
|
+
6
|
|
38
|
+
|
|
39
|
+
current = 1
|
|
40
|
+
visibleDate = [1,2,3,4]
|
|
@@ -87,7 +87,7 @@ function onClick(item: {
|
|
|
87
87
|
left: 0;
|
|
88
88
|
padding: 0 16px;
|
|
89
89
|
|
|
90
|
-
background-color:
|
|
90
|
+
background-color: var(--dev-tool-bg2-color);
|
|
91
91
|
box-sizing: border-box;
|
|
92
92
|
}
|
|
93
93
|
.web-socket-list-title {
|
|
@@ -110,18 +110,6 @@ function onClick(item: {
|
|
|
110
110
|
word-break: break-all;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
.web-socket-close {
|
|
114
|
-
flex-shrink: 0;
|
|
115
|
-
display: flex;
|
|
116
|
-
align-items: center;
|
|
117
|
-
justify-content: center;
|
|
118
|
-
width: 24px;
|
|
119
|
-
height: 24px;
|
|
120
|
-
margin-left: auto;
|
|
121
|
-
border-radius: 50%;
|
|
122
|
-
border: 1px solid #000;
|
|
123
|
-
box-sizing: border-box;
|
|
124
|
-
}
|
|
125
113
|
.web-socket-top {
|
|
126
114
|
display: flex;
|
|
127
115
|
align-items: center;
|
|
@@ -143,7 +131,7 @@ function onClick(item: {
|
|
|
143
131
|
.header-detail-item > view:first-child {
|
|
144
132
|
white-space: nowrap;
|
|
145
133
|
margin-right: 8px;
|
|
146
|
-
color:
|
|
134
|
+
color: var(--dev-tool-info-color);
|
|
147
135
|
}
|
|
148
136
|
|
|
149
137
|
.web-socket-data-item {
|
|
@@ -161,7 +149,7 @@ function onClick(item: {
|
|
|
161
149
|
/* margin-right: 16px; */
|
|
162
150
|
padding: 0 6px;
|
|
163
151
|
flex-shrink: 0;
|
|
164
|
-
color:
|
|
152
|
+
color: var(--dev-tool-info-color);
|
|
165
153
|
}
|
|
166
154
|
.web-socket-data-content {
|
|
167
155
|
padding: 6px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-uni-dev-tool",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "vite-uni-dev-tool, debug, uni-app, 一处编写,到处调试",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"main": "
|
|
22
|
-
"types": "
|
|
21
|
+
"main": "dist/index.js",
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
23
23
|
"files": [
|
|
24
|
-
"./
|
|
24
|
+
"./dist/"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build:lib": "vite build
|
|
27
|
+
"build:lib": "vite build"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"vue": ">=3.4.21",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="button" :style="style" @click="onClick">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</view>
|
|
5
|
-
</template>
|
|
6
|
-
<script lang="ts" setup>
|
|
7
|
-
defineProps<{ style?: any }>();
|
|
8
|
-
const emit = defineEmits<{ (e: 'click', event?: MouseEvent): void }>();
|
|
9
|
-
const onClick = (e: MouseEvent) => {
|
|
10
|
-
emit('click', e);
|
|
11
|
-
};
|
|
12
|
-
</script>
|
|
13
|
-
<style scoped>
|
|
14
|
-
.button {
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
width: 100%;
|
|
19
|
-
height: 32px;
|
|
20
|
-
border-radius: 4px;
|
|
21
|
-
color: #fff;
|
|
22
|
-
outline: none;
|
|
23
|
-
border: 1px solid transparent;
|
|
24
|
-
background-color: var(--dev-tool-main-color);
|
|
25
|
-
transform: all 0.3s;
|
|
26
|
-
font-size: var(--dev-tool-base-font-size);
|
|
27
|
-
padding: 0;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.button:active {
|
|
32
|
-
background-color: darken(#9254de, 10%);
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view
|
|
3
|
-
:class="`checkbox ${modelValue ? 'checkbox-active' : ''}`"
|
|
4
|
-
@click="onClickCheckbox"
|
|
5
|
-
>
|
|
6
|
-
{{ modelValue ? '√' : '' }}
|
|
7
|
-
</view>
|
|
8
|
-
</template>
|
|
9
|
-
<script lang="ts" setup>
|
|
10
|
-
const props = defineProps<{
|
|
11
|
-
modelValue?: boolean;
|
|
12
|
-
}>();
|
|
13
|
-
const emit = defineEmits<{
|
|
14
|
-
(e: 'update:modelValue', value: boolean): void;
|
|
15
|
-
(e: 'change', value: boolean): void;
|
|
16
|
-
}>();
|
|
17
|
-
|
|
18
|
-
function onClickCheckbox() {
|
|
19
|
-
const value = !props.modelValue;
|
|
20
|
-
emit('update:modelValue', value);
|
|
21
|
-
emit('change', value);
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
<style scoped>
|
|
25
|
-
.checkbox {
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
width: 18px;
|
|
30
|
-
height: 18px;
|
|
31
|
-
border-radius: 4px;
|
|
32
|
-
border: 1px solid var(--dev-tool-main-color);
|
|
33
|
-
transition: all 0.3s;
|
|
34
|
-
color: #fff;
|
|
35
|
-
box-sizing: border-box;
|
|
36
|
-
}
|
|
37
|
-
.checkbox-active {
|
|
38
|
-
background-color: var(--dev-tool-main-color);
|
|
39
|
-
}
|
|
40
|
-
</style>
|