Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const state = {
- return {
- form: new Form({
- id:null,
- fullname: null,
- username: null,
- email: null,
- password: null,
- role:null,
- })
- }
- }
- const actions = {
- toreData({commit,state},payload){
- commit('LOADING');
- return new Promise((resolve, reject)=>{
- let params = _.cloneDeep(state.form)
- state.form.post(APP_CONFIG.API_URL+'/users',params)
- .then(response =>{
- commit('RESET_STATE')
- resolve();
- })
- .catch(error =>{
- });
- });
- }
- }
- <div class="form-group">
- <label for="fullname">Full Name*</label>
- <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">
- <has-error :form="form" field="fullname"></has-error>
- </div>
Add Comment
Please, Sign In to add comment