UNPKG

1.49 kBMarkdownView Raw
1vue-submit
2=======================
3
4Helper for requests with confirmation, notification and loading status.
5
6### Instalation ###
7
8```js
9import Vue from 'vue';
10import VueSubmit from 'vue-submit';
11
12// Default options
13Vue.use( VueSubmit );
14
15// Or by using a framework name
16Vue.use( VueSubmit, "buefy" );
17
18// Or using full options
19Vue.use( VueSubmit, {
20 //! Framework to set
21 framework?: SubmitOptionsFramework,
22 //! Confirmation function to be called on the confirmation step
23 confirmation?: ( vm: any, confirmationData: any ) => any,
24 confirmationDefaults?: any,
25 //! Notification function to be called on notify step
26 notify?: ( vm: any, notifyData: any, notifyDefaults?: any ) => any,
27 notifyDefaults?: any,
28 notifyDefaultsError?: any,
29 notifyDefaultsErrorValidation?: any,
30 //! Set the request function
31 request?: ( vm: any, requestData: any ) => any,
32 requestDefaults?: any,
33 //! Compatibility options { Promise } for now
34 compat: SubmitManagerCompatOptions,
35});
36```
37
38### Usage ####
39```js
40
41this.$submit( "name", {
42 //! The validator to use (vuelidate compatible)
43 validator?: any,
44 //! Set to false if you do not want to trigger the loading bar from nuxt
45 loading?: Boolean,
46 //! Override the request functions
47 request?: ( vm: any, requestData: any ) => any,
48 //! Function to be called on success
49 success?: ( result: any ) => any,
50 //! Confirmation object passed to constructor
51 confirmation?: any,
52 //! Notify options on success and errors
53 notify?: any,
54 notifyError?: any,
55});
56```
57