Files
ComfyUI_frontend/src/components/graph/vueNodes/NodeContent.vue
bymyself 7e51bc45f9 [feat] Implement Vue-based node rendering components
- LGraphNode: Main container with transform-based positioning
- NodeHeader: Collapsible title bar with dynamic coloring
- NodeSlots: Input/output connection visualization
- NodeWidgets: Integration with existing widget system
- NodeContent: Extensibility placeholder
- Error boundaries and performance optimizations (v-memo, CSS containment)
2025-06-24 18:25:08 -07:00

34 lines
859 B
Vue
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div v-if="renderError" class="node-error p-2 text-red-500 text-sm">
Node Content Error
</div>
<div v-else class="lg-node-content">
<!-- Default slot for custom content -->
<slot>
<!-- This component serves as a placeholder for future extensibility -->
<!-- Currently all node content is rendered through the widget system -->
</slot>
</div>
</template>
<script setup lang="ts">
import type { LGraphNode } from '@comfyorg/litegraph'
import { onErrorCaptured, ref } from 'vue'
interface NodeContentProps {
node: LGraphNode
readonly?: boolean
}
defineProps<NodeContentProps>()
// Error boundary implementation
const renderError = ref<string | null>(null)
onErrorCaptured((error) => {
renderError.value = error.message
console.error('Vue node content error:', error)
return false
})
</script>