Show previously entered value in text field in custom integration #997
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think you might need to include the <input :value="globalParams.endpoint" @input="input('globalParams.endpoint', $event.target.value)"> We can't use But - we need to populate it somehow from Twig. {% set endpoint = form.settings.integrations[handle].endpoint ?? '' %}
<input :value="globalParams.endpoint" @input="input('globalParams.endpoint', $event.target.value)" :run="!globalParams.endpoint ? globalParams.endpoint = '{{ endpoint }}' : true"> Here, we mix Vue and Twig which will essentially output: I think that should help! |
Beta Was this translation helpful? Give feedback.
I think you might need to include the
:run
attribute. This basically allows you to run code when Vue runs, which is pretty neat! What this does is basically populate theglobalParams.layout
prop with the value from Twig, if it's set. You can see this is the SharpSpring integration.We can't use
v-model
due to this being in a scoped slot, otherwise this would be a bit more concise. So we use the expanded:value
/@input
syntax.globalParams
is essentially an empty object that we can use to add whatever variables you need.But - we need to populate it somehow from Twig.