Inputs with data returned by the server

1

I'm using vue + axion + bootstrap and I want to make some forms.
I declare some inputs with the v-model class like this:

<div class="form-group">
<label for="user" class="control-label col-md-2">Nombre</label>
<div class="col-md-10">
<input v-model="Usuario_Nom" type="text" class="form-control" name="nombre" id="nombre" placeholder="su nombre" />
</div>
</div>

where I want the data returned by the server to come out. I create the script to connect to the server and collect the data.
In the vue script I declare:

data: {
  datos: [],
  Usuario_Nom: '',
  Usuario_xxx: '',
   ... 
  }

and in the then

this.datos = response.data;
this.Usuario_Nom = this.datos.Usuario.Nombre;
this..... //El resto de datos del formulario

All this I execute by pressing a button like this

<div class="form-group col-md-2">
<button class="btn btn-primary" name="btEnviar" v-on:click="getUsuarios(user.value,pass.value)">Enviar</button>
</div>

All this is executed and it works but the data is not saved in the inputs. Actually they are saved but for a fraction of a second and disappear, as if the page was reloaded.

Any idea why this happens?

    
asked by user84691 25.04.2018 в 16:23
source

0 answers