优化输出日志的颜色

This commit is contained in:
xu_yanfeng
2024-12-24 21:09:13 +08:00
parent d62cc0a26c
commit 27f4884216
13 changed files with 199 additions and 181 deletions

View File

@@ -14,7 +14,7 @@
<script lang="ts">
import ccui from "@xuyanfeng/cc-ui";
import { defineComponent, PropType, ref, watch } from "vue";
import { defineComponent, PropType, ref, toRaw, watch } from "vue";
import Bus, { BusMsg } from "../bus";
import { Group } from "../data";
import UiProp from "./ui-prop.vue";
@@ -53,7 +53,8 @@ export default defineComponent({
return {
fold,
onLog() {
Bus.emit(BusMsg.LogData, [props.group.id]);
const raw = toRaw(props);
Bus.emit(BusMsg.LogData, [raw.group.id]);
},
};
},

View File

@@ -35,7 +35,7 @@ import { nextTick } from "process";
import { defineComponent, onMounted, onUnmounted, PropType, ref, toRaw, watch } from "vue";
import { Msg } from "../../../core/types";
import Bus, { BusMsg } from "../bus";
import { connectBackground } from "../connectBackground";
import { bridge } from "../bridge";
import { DataType, EngineData, EnumData, ImageData, Info, NumberData, Property, StringData, TextData, Vec2Data, Vec3Data } from "../data";
import Engine from "./property-engine.vue";
import PropertyImage from "./property-image.vue";
@@ -139,7 +139,8 @@ export default defineComponent({
},
onChangeValue() {
if (!props.value.readonly) {
connectBackground.postMessageToBackground(Msg.SetProperty, toRaw(props.value));
const raw = toRaw(props.value);
bridge.send(Msg.SetProperty, raw);
}
},
};