<template>
    <form @submit.prevent="update">
        
<div class="form-group row">
    <div class="col-md-6">
        <label for="email">Email</label>
        <input type="hidden" name="id" id="id" v-model="fields.id">
        <input type="text" name="email" v-model="fields.email" class="form-control" placeholder="Enter email..">
        <div v-if="errors && errors.email" class="text-danger">{{ errors.email[0] }}</div>
    </div>
    <div class="col-md-6">
        <label for="description">username</label>
        <input type="text" name="username" v-model="fields.username" class="form-control" placeholder="Enter username..">

        <div v-if="errors && errors.username" class="text-danger">{{ errors.username[0] }}</div>
    </div>

    <div class="col-md-6">
        <label for="description"> Password</label>
        <input type="password" name="password_confirmation" v-model="fields.password_confirmation" class="form-control" placeholder="Enter confirm_password..">

        <div v-if="errors && errors.password_confirmation" class="text-danger">{{ errors.password_confirmation[0] }}</div>
    </div>


    <div class="col-md-6">
        <label for="password">Confirm Password</label>
        <input type="password" name="password" v-model="fields.password" class="form-control" placeholder="Enter password..">
        <div v-if="errors && errors.password" class="text-danger">{{ errors.password[0] }}</div>
    </div>
  
  
    </div>




        <div class="form-group">
            <button type="submit" class="btn btn-success btn-round">Save</button>
            <button type="reset" class="btn btn-danger btn-round">Clear</button>
        </div>       
        

        
    </form>
</template>

<script>
import FormMixin from '../shared/FormMixin';

export default {
  mixins: [ FormMixin ],
  props: ['customeruserdata'],
  data() {
    return {
      'action2': '/at/updatepasswordconfirm',
      'text': 'User Updated succesfully',
      'redirect': '',
      fields: {
          id:this.customeruserdata.id,
          email:this.customeruserdata.email,
          username:this.customeruserdata.username,
          password:'',
          password_confirmation:'',
 
      }
    }
  },
  mounted(){
          this.fields.id=this.customeruserdata.id;
          this.fields.email=this.customeruserdata.email;
          this.fields.username=this.customeruserdata.username;
        //   this.fields.password=this.customeruserdata.password;
        //   this.fields.password_confirmation=this.customeruserdata.password_confirmation;
      
  }
}

</script>