You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started.md
+33-13Lines changed: 33 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,22 +269,42 @@ The following default options are available for configuration:
269
269
270
270
```js
271
271
constdefaultOptions= {
272
-
autoRemove:false, // Automatically remove records missing from responses (only use with feathers-rest)
273
-
addOnUpsert:false, // Add new records pushed by 'updated/patched' socketio events into store, instead of discarding them
274
-
enableEvents:true, // Listens to socket.io events when available. See the `handleEvents` API for more details
275
-
idField:'id', // The field in each record that will contain the id
276
-
tempIdField:'__id',
277
-
debug:false, // Set to true to enable logging messages.
278
-
keepCopiesInStore:false, // Set to true to store cloned copies in the store instead of on the Model.
279
-
nameStyle:'short', // Determines the source of the module name. 'short', 'path', or 'explicit'
280
-
paramsForServer: [], // Custom query operators that are ignored in the find getter, but will pass through to the server.
281
-
preferUpdate:false, // When true, calling model.save() will do an update instead of a patch.
282
-
replaceItems:false, // Instad of merging in changes in the store, replace the entire record.
272
+
// configured globally
283
273
serverAlias:'api',
284
-
skipRequestIfExists:false, // For get action, if the record already exists in store, skip the remote request
285
-
whitelist: [] // Custom query operators that will be allowed in the find getter.
274
+
keepCopiesInStore:false,
275
+
paramsForServer: [],
276
+
whitelist: []
277
+
278
+
// also configurable per service
279
+
idField:'id',
280
+
tempIdField:'__id',
281
+
debug:false,
282
+
addOnUpsert:false,
283
+
autoRemove:false,
284
+
enableEvents:true,
285
+
preferUpdate:false,
286
+
replaceItems:false,
287
+
skipRequestIfExists:false,
288
+
nameStyle:'short',
286
289
}
287
290
```
291
+
-`serverAlias` - **Default:**`api` - Models are keyed by `serverAlias`. Access the `$FeathersVuex` Plugin and its models in your components by `this.$FeathersVuex.api.${Model}`
292
+
-`keepCopiesInStore` - **Default:**`false` - Set to true to store cloned copies in the store instead of on the Model. <Badgetext="deprecated"type="warning" />
293
+
-`paramsForServer {Array}` - **Default:**`[]` - Custom query operators that are ignored in the find getter, but will pass through to the server.
294
+
-`whitelist {Array}` - **Default:**`[]` - Custom query operators that will be allowed in the find getter.
295
+
296
+
-`idField {String}` - **Default:**`'id'` - The field in each record that will contain the id
297
+
-`tempIdField {Boolean}` - **Default:**`'__id'` - The field in each temporary record that contains the id
298
+
-`debug {Boolean}` - **Default:**`false` - Enable some logging for debugging
299
+
-`addOnUpsert {Boolean}` - **Default:**`false` - If `true` add new records pushed by 'updated/patched' socketio events into store, instead of discarding them.
300
+
-`autoRemove {Boolean}` - **Default:**`false` - If `true` automatically remove records missing from responses (only use with feathers-rest)
301
+
-`enableEvents {Boolean}` - **Default:**`true` - If `false` socket event listeners will be turned off. See the services [handleEvents API](/service-plugin.html#configuration)
302
+
-`preferUpdate {Boolean}` - **Default:**`false` - If `true`, calling `model.save()` will do an `update` instead of a `patch`.
303
+
-`replaceItems {Boolean}` - **Default:**`false` - If `true`, updates & patches replace the record in the store. Default is false, which merges in changes.
304
+
-`skipRequestIfExists {Boolean}` - **Default:**`false` - For get action, if `true` the record already exists in store, skip the remote request.
305
+
-`nameStyle {'short'|'path'}` - **Default:**`'short'` - Use the full service path as the Vuex module name, instead of just the last section.
306
+
307
+
Also see the [Configs per Service](/service-plugin.html#configuration)
@@ -65,12 +65,12 @@ The following options can also be configured in [Global Configuration](getting-s
65
65
-`idField {String}` - **Default:**`'id'` - The field in each record that will contain the id
66
66
-`tempIdField {Boolean}` - **Default:**`'__id'` - The field in each temporary record that contains the id
67
67
-`debug {Boolean}` - **Default:**`false` - Enable some logging for debugging
68
-
-`autoRemove {Boolean}` - **Default:**`false` - If `true` automatically remove records missing from responses (only use with feathers-rest)
69
68
-`addOnUpsert {Boolean}` - **Default:**`false` - If `true` add new records pushed by 'updated/patched' socketio events into store, instead of discarding them.
69
+
-`autoRemove {Boolean}` - **Default:**`false` - If `true` automatically remove records missing from responses (only use with feathers-rest)
70
+
-`enableEvents {Boolean}` - **Default:**`true` - If `false` socket event listeners will be turned off
71
+
-`preferUpdate {Boolean}` - **Default:**`false` - If `true`, calling `model.save()` will do an `update` instead of a `patch`.
70
72
-`replaceItems {Boolean}` - **Default:**`false` - If `true`, updates & patches replace the record in the store. Default is false, which merges in changes.
71
73
-`skipRequestIfExists {Boolean}` - **Default:**`false` - For get action, if `true` the record already exists in store, skip the remote request.
72
-
-`preferUpdate {Boolean}` - **Default:**`false` - If `true`, calling `model.save()` will do an `update` instead of a `patch`.
73
-
-`enableEvents {Boolean}` - **Default:**`true` - If `false` socket event listeners will be turned off
74
74
-`nameStyle {'short'|'path'}` - **Default:**`'short'` - Use the full service path as the Vuex module name, instead of just the last section.
75
75
76
76
The following options can only configured individually per service plugin
@@ -85,7 +85,7 @@ The following options can only configured individually per service plugin
85
85
-`patched {Function}` - **Default:**`(item, { model, models }) => options.enableEvents` - handle `created` events, return true to update in the store
86
86
-`updated {Function}` - **Default:**`(item, { model, models }) => options.enableEvents` - handle `created` events, return true to update in the store
87
87
-`removed {Function}` - **Default:**`(item, { model, models }) => options.enableEvents` - handle `removed` events, return true to remove from the store
88
-
88
+
89
89
-`state {Object}` - **Default:**: `null` - Pass custom `states` to the service plugin or modify existing ones
90
90
-`getters {Object}` - **Default:**`null` - Pass custom `getters` to the service plugin or modify existing ones
91
91
-`mutations {Object}` - **Default:**`null` - Pass custom `mutations` to the service plugin or modify existing ones
@@ -115,7 +115,7 @@ Each service comes loaded with the following default state:
115
115
idField:'id',
116
116
keyedById: {},
117
117
tempsById: {},
118
-
tempsByNewId: {},
118
+
tempsByNewId: {},
119
119
pagination: {
120
120
defaultLimit:null,
121
121
defaultSkip:null
@@ -124,7 +124,7 @@ Each service comes loaded with the following default state:
0 commit comments