john
2025-05-27 ad3c5e302eb0467b6a5a713476836d48758e7019
docs: 自定义节点文档更新。
1个文件已修改
19 ■■■■■ 已修改文件
docs/zh/development/ai/custom-node.md 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/zh/development/ai/custom-node.md
@@ -56,7 +56,8 @@
        },
        forms: [  // 节点表单
            {
                type: 'heading', // 'input' | 'textarea' | 'select' | 'slider' | 'heading'
                // 'input' | 'textarea' | 'select' | 'slider' | 'heading' | 'chosen'
                type: 'heading',
                label: '表单头',
            },
            {
@@ -71,6 +72,22 @@
                        value: 'docx'
                    }
                ]
            },
            {
                // 用法可参考插件节点的代码
                type: 'chosen',
                label: '插件选择',
                chosen: {
                    // 节点自定义属性
                    labelDataKey: 'pluginName',
                    valueDataKey: 'pluginId',
                    // updateNodeData 可动态更新节点属性
                    // value 为选中的 value
                    // label 为选中的 label
                    onChosen: ((updateNodeData: (data: Record<string, any>) => void, value?: string, label?: string, event?: Event) => {
                        console.warn('No onChosen handler provided for plugin-node');
                    })
                }
            }
        ],
    }