refactor(plugin-workflow): allow to use function for values when creating node (#3002)

This commit is contained in:
Junyi 2023-11-09 01:20:56 +08:00 committed by GitHub
parent 8ee8b0052a
commit e74fcc32e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ export function AddButton(props: AddButtonProps) {
const instruction = instructions.get(type); const instruction = instructions.get(type);
if (optionKey) { if (optionKey) {
const { value } = instruction.options?.find((item) => item.key === optionKey) ?? {}; const { value } = instruction.options?.find((item) => item.key === optionKey) ?? {};
Object.assign(config, value); Object.assign(config, typeof value === 'function' ? value() : value);
} }
if (resource) { if (resource) {