@renanhangai/vue-submit
Vue submit helper
Last updated 9 months ago by renanhangai .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @renanhangai/vue-submit 
SYNC missed versions from official npm registry.

vue-submit

Helper for requests with confirmation, notification and loading status.

Instalation

import Vue from 'vue';
import VueSubmit from 'vue-submit';

// Default options
Vue.use( VueSubmit );

// Or by using a framework name
Vue.use( VueSubmit, "buefy" );

// Or using full options 
Vue.use( VueSubmit, {
	//! Framework to set
	framework?: SubmitOptionsFramework,
	//! Confirmation function to be called on the confirmation step
	confirmation?: ( vm: any, confirmationData: any ) => any,
	confirmationDefaults?: any,
	//! Notification function to be called on notify step
	notify?: ( vm: any, notifyData: any, notifyDefaults?: any ) => any,
	notifyDefaults?: any,
	notifyDefaultsError?: any,
	notifyDefaultsErrorValidation?: any,
	//! Set the request function
	request?: ( vm: any, requestData: any ) => any,
	requestDefaults?: any,
	//! Compatibility options { Promise } for now
	compat: SubmitManagerCompatOptions,
}); 

Usage


this.$submit( "name", {
	//! The validator to use (vuelidate compatible)
	validator?: any,
	//! Set to false if you do not want to trigger the loading bar from nuxt
	loading?:   Boolean,
	//! Override the request functions
	request?: ( vm: any, requestData: any ) => any,
	//! Function to be called on success
	success?: ( result: any ) => any,
	//! Confirmation object passed to constructor
	confirmation?: any,
	//! Notify options on success and errors
	notify?: any,
	notifyError?: any,
});

Capturing errors

this.$submit( "name", {
	notifyError({ data }) {
		// do something with the data
	}
})

Current Tags

  • 2.3.0                                ...           latest (9 months ago)

34 Versions

  • 2.3.0                                ...           9 months ago
  • 2.2.1                                ...           a year ago
  • 2.2.0                                ...           a year ago
  • 2.1.2                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.5.0                                ...           2 years ago
  • 1.4.1                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.3                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.4                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |