This commit is contained in:
xu_yanfeng 2025-01-27 09:08:30 +08:00
parent 95fa6ec276
commit f7bd7790e1
2 changed files with 9 additions and 8 deletions

View File

@ -222,8 +222,10 @@ export default defineComponent({
const picking = ref(false);
const rootEl = ref<HTMLDivElement>(null);
const showBtns = ref(true);
if (config.value.autoHide) {
showBtns.value = false;
}
let autoHideTimer = null;
let autoHide = toRaw(config.value.autoHide);
let isDraging = false;
return {
showBtns,
@ -241,13 +243,12 @@ export default defineComponent({
const arr: IUiMenuItem[] = [
{
name: "auto hide",
selected: autoHide,
selected: config.value.autoHide,
callback: () => {
autoHide = !autoHide;
config.value.autoHide = autoHide;
config.value.autoHide = !config.value.autoHide;
appStore().save();
ga(GA_EventName.MouseMenu, "auto hide");
if (!autoHide) {
if (!config.value.autoHide) {
clearTimeout(autoHideTimer);
showBtns.value = true;
}
@ -260,7 +261,7 @@ export default defineComponent({
if (isDraging) {
return;
}
if (!autoHide) {
if (!config.value.autoHide) {
return;
}
autoHideTimer = setTimeout(() => {

View File

@ -102,9 +102,9 @@ export class Inspector extends InjectEvent {
case Msg.RequestLogCustom: {
const logFunction = console.log;
logFunction(pluginEvent.data);
break;
}
case Msg.ReqWriteClipboard: {
document.body.focus();
navigator.clipboard
.writeText(pluginEvent.data)
@ -343,7 +343,7 @@ export class Inspector extends InjectEvent {
return true;
}
} else {
if (node instanceof type) {
if (type && node instanceof type) {
if (keys.find((v) => v === key)) {
return true;
}