Commit 5d091f6c authored by void's avatar void
Browse files

arreglar que los inputs en Form se borran al submittearse

la solución es un poco complicada, pero funciona. también arreglé un problema con el textarea que tenía la tabulación mal.
parent 1c9a3a35
Pipeline #35317 passed with stages
in 1 minute and 42 seconds
......@@ -24,9 +24,7 @@
:placeholder="field.placeholder"
:required="field.required"
:minlength="field.minLength"
>
{{ field.value }}
</textarea
>{{ field.value }}</textarea
>
<select
v-else-if="field.type === 'select'"
......@@ -51,7 +49,7 @@
:placeholder="field.placeholder"
:required="field.required"
:minlength="field.minLength"
:value="field.value"
v-model="inputValueBinds[field.name]"
/>
</field>
</template>
......@@ -69,10 +67,18 @@ export default {
components: { Field, CustomButton },
props: ['fields', 'handleSubmit', 'parseError'],
data() {
const inputFields = this.fields.filter(field => field.type === 'input')
let binds = {}
for (const field of inputFields) {
binds[field.name] = field.name || ''
}
return {
error: null,
errors: {},
loading: false,
inputValueBinds: binds,
}
},
methods: {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment