Files
AllinSSL/frontend/apps/vue-flow/components/configs/StartNodeConfig.tsx
2026-01-13 17:47:39 +08:00

46 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineComponent } from 'vue'
import { useWorkflowStore } from '../../store/workflow'
import { StartNodeData } from '../../types'
import configStyles from './Config.module.css'
export default defineComponent({
name: 'StartNodeConfig',
props: {
nodeId: {
type: String,
required: true,
},
nodeData: {
type: Object as () => StartNodeData,
required: true,
},
},
setup(props) {
const workflowStore = useWorkflowStore()
const updateNodeLabel = (value: string) => {
workflowStore.updateNodeData(props.nodeId, { label: value })
}
return () => (
<div class={configStyles.configContainer}>
<div class={configStyles.configField}>
<div class={configStyles.configLabel}></div>
<input
type="text"
value={props.nodeData.label}
onInput={(e) => updateNodeLabel((e.target as HTMLInputElement).value)}
class={configStyles.configInput}
/>
</div>
<div class={configStyles.configInfo}>
<div class={configStyles.configInfoTitle}></div>
<div class={configStyles.configInfoContent}>
</div>
</div>
</div>
)
},
})