<template>
    <form @submit.prevent="update">
        
<div class="form-group row">
    <div class="col-md-6">
        <label for="fname">First Name</label>
        <input type="hidden" name="customer_id" id="customer_id" v-model="fields.customer_id">
        <input type="text" name="fname" v-model="fields.fname" class="form-control" placeholder="Enter First Name...">
        <div v-if="errors && errors.fname" class="text-danger">{{ errors.fname[0] }}</div>
    </div>
       <div class="col-md-6">
        <label for="lname">Last Name</label>
        <input type="text" name="lname" v-model="fields.lname" class="form-control" placeholder="Enter Last name...">
        <div v-if="errors && errors.lname" class="text-danger">{{ errors.lname[0] }}</div>
    </div>
       <div class="col-md-6">
        <label for="username">UserName</label>
        <input type="text" name="username" v-model="fields.username" class="form-control" placeholder="Enter User name...">
        <div v-if="errors && errors.username" class="text-danger">{{ errors.username[0] }}</div>
    </div>
       <div class="col-md-6">
        <label for="password">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 class="col-md-6">
        <label for="confirmpassword">Confirm Password</label>
        <input type="text" name="confirmpassword" v-model="fields.confirmpassword" class="form-control" placeholder="Enter confirm Password...">
        <div v-if="errors && errors.confirmpassword" class="text-danger">{{ errors.confirmpassword[0] }}</div>
    </div>
       <div class="col-md-6">
        <label for="email">Email</label>
        <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>

      
        

        
    </form>
</template>

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

export default {
  mixins: [ FormMixin ],
  props: ['customeruserdata'],
  data() {
    return {
      'action2': '/at/bundlesuser/updateCustomerUser',
      'text': 'User Updated succesfully',
      'redirect': '',
      fields: {
          customer_id:this.customeruserdata.customer_id,
          fname:this.customeruserdata.fname,
          lname:this.customeruserdata.lname,
          username:this.customeruserdata.username,
          password:this.customeruserdata.password,
          phone:this.customeruserdata.phone,

          email:this.customeruserdata.email,
 
      }
    }
  },
  mounted(){
          this.fields.customer_id=this.customeruserdata.customer_id;
          this.fields.fname=this.customeruserdata.fname;
          this.fields.lname=this.customeruserdata.lname;
             this.fields.username=this.customeruserdata.username;
          this.fields.password=this.customeruserdata.password;
             this.fields.phone=this.customeruserdata.phone;

          this.fields.email=this.customeruserdata.email;

      
  }
}

</script>