Просмотр исходного кода

fix(demo): when title changed, sync variable as well (#178)

Yiwei Mao 8 месяцев назад
Родитель
Сommit
a899340f66

+ 1 - 1
apps/demo-fixed-layout/src/plugins/sync-variable-plugin/sync-variable-plugin.ts

@@ -68,7 +68,7 @@ export const createSyncVariablePlugin: PluginCreator<SyncVariablePluginOptions>
 
           // Listen for changes in the form values and re-synchronize when outputs change
           form.onFormValuesChange((props) => {
-            if (props.name.match(/^outputs/)) {
+            if (props.name.match(/^outputs/) || props.name.match(/^title/)) {
               syncOutputs(form.getValueIn('outputs'));
             }
           });

+ 1 - 1
apps/demo-free-layout/src/plugins/sync-variable-plugin/sync-variable-plugin.ts

@@ -68,7 +68,7 @@ export const createSyncVariablePlugin: PluginCreator<SyncVariablePluginOptions>
 
           // Listen for changes in the form values and re-synchronize when outputs change
           form.onFormValuesChange((props) => {
-            if (props.name.match(/^outputs/)) {
+            if (props.name.match(/^outputs/) || props.name.match(/^title/)) {
               syncOutputs(form.getValueIn('outputs'));
             }
           });