Skip to content

Commit 0f48abe

Browse files
committed
update readme with correct url and add configurations documentaiton
1 parent d560523 commit 0f48abe

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

Diff for: README.md

+21-10
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ function useDatatableUrlSync(route: any, router: any, form: GenericDictionnary,
9090
| router | The route instance from vue router. As it differe from Vue2 and Vue3 we can't import it automatically and need to have the instance in parameter |
9191
| form | A simple object used to filter the form. This object is synchronized with the url. When it change it reset the page attribute of the options variable |
9292
| fetchDatas | Callback function called when options or form changed or after a reload with the correct parameter to send to the backend for backend pagination or custom actions. This function take 2 parameter: queryParams, queryAsObject that are the data transformed by VDUS to match your backend criteria in string or object format. |
93-
| options | The options used for the datatable. It follow a strict pattern. See [VDUSDatatableOptions](#TODO) type for more informations. If your server use other query identifier use formSchema to change their name before fetchDatas been called |
94-
| formSchema | Optional. The object that allow you to customize the defaut value, the type and the names send to the backend. See [VDUSFormSchema](#TODO) type for the structure and [the documentation section](#TODO) to understand how to use it |
93+
| options | The options used for the datatable. It follow a strict pattern. See [VDUSDatatableOptions](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L15) type for more informations. If your server use other query identifier use formSchema to change their name before fetchDatas been called |
94+
| formSchema | Optional. The object that allow you to customize the defaut value, the type and the names send to the backend. See [VDUSFormSchema](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L11) type for the structure and [the documentation section](#formschema) to understand how to use it |
9595
| initializeForm | Optional. A callback function called at the component creation to allow developer to adapt behavior depending of the query params in the url if needed. Usefull if to value are non-compatible because user change it manually. |
96-
| configurations | Optional. Object that allow to personnalise the behavior of VDUS in specific case. See [VDUSConfiguration](#TODO) type and [the documentation section](#TODO) to understand how to use it |
96+
| configurations | Optional. Object that allow to personnalise the behavior of VDUS in specific case. See [VDUSConfiguration](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L21) type and [the documentation section](#configurations) to understand how to use it |
9797

9898

9999
# useDatatableUrlSync returned values
@@ -104,14 +104,25 @@ function useDatatableUrlSync(route: any, router: any, form: GenericDictionnary,
104104
| vuetifyOptions | The datatable options on the vuetify format to be able to use it directly in the template without the need to transform it |
105105

106106

107+
# Configurations
108+
109+
Configurations object allow you to personnalize the behavior of vue-datatable-url-sync. All the configurations are optionals
110+
111+
| Key name | Default | Description |
112+
| --------- | ------------ | ----------------------------------------------------------------- |
113+
| prefix | "" | Prefix all the params by a string only in the url to allow you have multiple instance of VDUS in the same html page |
114+
| debounceTime | 0 | Allow you to specify a debounce time before sending request to your server. This is usefull when you have only text field but can bring lag feeling when using checkbox or select. You can also use debounce directly in your component to personalize this behavior |
115+
| serveurDefaultPageSize | 10 | The default value for you backend pagination to be sure to send it if the default value in front is different that the one in your back |
116+
| extraQueryParams | {} | Put variable in the url and send them to your back even if not in your form |
117+
107118
# FormSchema
108119

109120
The parameter formSchema allow you to adapt the default behavior of vue-datatable-url-sync for each parameter (for the form AND for the options).
110121
With it you can specify the type of the params, the default value and the query param name to send to the server.
111122

112-
[See the type to understand better](#TODO)
123+
[See the type to understand better](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L11)
113124

114-
Here is the description of the type for the configuration of each params ((ParamSchema)[#TODO])
125+
Here is the description of the type for the configuration of each params ([ParamSchema](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L5))
115126

116127
| Key name | Description |
117128
| --------- | ----------------------------------------------------------------- |
@@ -124,8 +135,8 @@ Here is the description of the type for the configuration of each params ((Param
124135

125136
| Type name | Description |
126137
| ----------- | ------------------------------------------------------------------- |
127-
| [GenericDictionnary](#TODO) | Generic object that accept any key and any value |
128-
| [VDUSParamSchema](#TODO) | Object describing how to handle query param when reading them from url or before sending them to the backend server |
129-
| [VDUSFormSchema](#TODO) | Object describing how to handle the form and options object passed as parameter of useDatatableUrlSync |
130-
| [VDUSDatatableOptions](#TODO) | Object describing the params accepted in the datatable options |
131-
| [VDUSConfiguration](#TODO) | Configuration object for vue datatable url sync |
138+
| [GenericDictionnary](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L1) | Generic object that accept any key and any value |
139+
| [VDUSParamSchema](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L5) | Object describing how to handle query param when reading them from url or before sending them to the backend server |
140+
| [VDUSFormSchema](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L11) | Object describing how to handle the form and options object passed as parameter of useDatatableUrlSync |
141+
| [VDUSDatatableOptions](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L15) | Object describing the params accepted in the datatable options |
142+
| [VDUSConfiguration](https://github.com/socotecio/vue-datatable-url-sync/blob/main/src/utils/VDUSTypes.ts#L21) | Configuration object for vue datatable url sync |

0 commit comments

Comments
 (0)