perf: 完善黑夜模式的表现效果,工作流编排幕布和节点在黑夜模式正常表现

This commit is contained in:
2026-03-04 19:56:20 +08:00
parent 27376a5f33
commit a79718b03b
33 changed files with 605 additions and 363 deletions

View File

@@ -5,7 +5,7 @@
<script setup lang="ts">
import {Tinyflow as TinyflowNative, TinyflowOptions} from '@tinyflow-ai/ui';
import '@tinyflow-ai/ui/dist/index.css';
import {onMounted, onUnmounted, ref} from 'vue';
import {onMounted, onUnmounted, ref, watch} from 'vue';
const props = defineProps<
{
@@ -55,6 +55,15 @@ onUnmounted(() => {
}
});
watch(
() => props.theme,
(theme) => {
if (tinyflow) {
tinyflow.setTheme(theme || 'light');
}
}
);
const getData = () => {
if (tinyflow) {
return tinyflow.getData();
@@ -71,8 +80,17 @@ const getInstance = () => {
return null;
};
const focusNode = async (nodeId: string, options?: { duration?: number; zoom?: number }) => {
if (tinyflow) {
return tinyflow.focusNode(nodeId, options);
}
console.warn('Tinyflow instance is not initialized');
return false;
};
defineExpose({
getData,
getInstance
getInstance,
focusNode
});
</script>