Guest User

Untitled

a guest
Dec 25th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. const state = {
  2. return {
  3. form: new Form({
  4. id:null,
  5. fullname: null,
  6. username: null,
  7. email: null,
  8. password: null,
  9. role:null,
  10. })
  11. }
  12. }
  13.  
  14. const actions = {
  15. toreData({commit,state},payload){
  16. commit('LOADING');
  17. return new Promise((resolve, reject)=>{
  18. let params = _.cloneDeep(state.form)
  19.  
  20. state.form.post(APP_CONFIG.API_URL+'/users',params)
  21. .then(response =>{
  22. commit('RESET_STATE')
  23. resolve();
  24. })
  25. .catch(error =>{
  26. });
  27. });
  28. }
  29. }
  30.  
  31. <div class="form-group">
  32. <label for="fullname">Full Name*</label>
  33. <input type="text" :class="{ 'is-invalid': form.errors.has('fullname') }" :value="form.fullname" @input="updateFullname" autocomplete="off" placeholder="Full Name" class="form-control" name="fullname" id="fullname">
  34. <has-error :form="form" field="fullname"></has-error>
  35. </div>
Add Comment
Please, Sign In to add comment