mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-20 00:48:43 +00:00
统一print变量的功能,提示将值临时到window.c
This commit is contained in:
parent
4f2abca667
commit
641c291619
@ -8,7 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<div style="flex: 1"></div>
|
<div style="flex: 1"></div>
|
||||||
<i style="" @click.stop="onLog" class="print iconfont icon_print"></i>
|
<i style="" @click.stop="onLog" class="print iconfont icon_print" title="值会临时保存到window.c"></i>
|
||||||
</template>
|
</template>
|
||||||
<div style="padding-left: 6px">
|
<div style="padding-left: 6px">
|
||||||
<UiProp v-for="(item, index) in group.data" :key="index" :name="item.name" :value="item.value"> </UiProp>
|
<UiProp v-for="(item, index) in group.data" :key="index" :name="item.name" :value="item.value"> </UiProp>
|
||||||
|
@ -4,12 +4,14 @@
|
|||||||
<img :src="data.data" alt="图片" @click="onClickImg" class="img" />
|
<img :src="data.data" alt="图片" @click="onClickImg" class="img" />
|
||||||
</div>
|
</div>
|
||||||
<div class="url" :title="data.desc">{{ data.desc }}</div>
|
<div class="url" :title="data.desc">{{ data.desc }}</div>
|
||||||
<i class="print iconfont icon_print" @click="onShowValueInConsole"></i>
|
<i class="print iconfont icon_print" title="值会临时保存到window.c" @click="onShowValueInConsole"></i>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, PropType, toRaw } from "vue";
|
import { defineComponent, PropType, toRaw } from "vue";
|
||||||
|
import { Msg, RequestLogData } from "../../../core/types";
|
||||||
|
import { bridge } from "../bridge";
|
||||||
import { ImageData } from "../data";
|
import { ImageData } from "../data";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@ -30,11 +32,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
onShowValueInConsole() {
|
onShowValueInConsole() {
|
||||||
if (Array.isArray(props.data.path)) {
|
if (Array.isArray(props.data.path)) {
|
||||||
let uuid = props.data.path[0];
|
let rawPath = toRaw(props.data.path);
|
||||||
let key = props.data.path[1]; // todo 暂时只支持一级key
|
bridge.send(Msg.RequestLogData, rawPath as RequestLogData);
|
||||||
if (uuid && key) {
|
|
||||||
chrome.devtools.inspectedWindow.eval(`window.CCInspector.logValue('${uuid}','${key}')`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user