RFC Discussion: [RFC] Vue component rendering system for custom nodes #34
Replies: 2 comments 1 reply
-
|
rfcs/rfcs/0004-vue-component-rendering-system.md Lines 277 to 291 in ed2ea11 In general, it will be more maintanable and allow consistent design/styles/UX if the available component library exposed publically meets 99% of custom node dev needs. Although it's also possible to create/register custom Vue components: you can create a Vue component file manually, add it to the import { app } from "../../../scripts/app.js";
import { addWidget, ComponentWidgetImpl } from "../../../scripts/domWidget.js";
import VueExampleComponent from "@/components/VueExampleComponent.vue";
app.registerExtension({
name: 'vue-basic',
getCustomWidgets(app) {
return {
// Create custom Vue component widget
CUSTOM_VUE_COMPONENT_BASIC(node) {
const inputSpec = {
name: 'custom_vue_component_basic',
type: 'vue-basic',
}
const widget = new ComponentWidgetImpl({
node,
name: inputSpec.name,
component: VueExampleComponent,
inputSpec,
options: {}
})
addWidget(node, widget)
return {widget}
}
}
},
nodeCreated(node) {
if (node.constructor.comfyClass !== 'vue-basic') return
const [oldWidth, oldHeight] = node.size
node.setSize([Math.max(oldWidth, 300), Math.max(oldHeight, 520)])
}
});The system would then need a very small adjustment to load Vue components added at runtime if they are passed by name in the websocket message. |
Beta Was this translation helpful? Give feedback.
-
|
From @ltdrdata
The API for rendering frontend components/elements can also be extended to work with the existing developer APIs like
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
This is the discussion thread for RFC PR #33.
Please provide feedback and discuss the RFC here rather than in the PR comments.
PR Link: #33
Beta Was this translation helpful? Give feedback.
All reactions