perf: 完善黑夜模式的表现效果,工作流编排幕布和节点在黑夜模式正常表现
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user