File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -35,22 +35,27 @@ Because the service's Model [is available](./service-plugin.html#The-FeathersCli
35
35
As an example, this ` speeding-tickets ` service has a ` summary ` attribute that comes back in the response. We can
36
36
37
37
``` js
38
- import feathersVuex from ' feathers-vuex'
39
- import feathersClient from ' ../../feathers-client'
40
-
41
- const { service } = feathersVuex (feathersClient, { idField: ' _id' })
38
+ import { makeServicePlugin , BaseModel } from ' ../feathers-client'
42
39
43
- const servicePath = ' speeding-tickets'
44
- const servicePlugin = service (servicePath, {
45
- instanceDefaults: {
46
- vin: ' ' ,
47
- plateState: ' '
48
- },
49
- mutations: {
50
- handleSummaryData (state , summaryData ) {
51
- state .mostRecentSummary = summaryData
40
+ class SpeedingTicket extends BaseModel {
41
+ constructor (data , options ) {
42
+ super (data, options)
43
+ }
44
+ // Required for $FeathersVuex plugin to work after production transpile.
45
+ static modelName = ' SpeedingTicket'
46
+ // Define default properties here
47
+ static instanceDefaults () {
48
+ return {
49
+ email: ' ' ,
50
+ password: ' '
52
51
}
53
52
}
53
+ }
54
+ const servicePath = ' speeding-tickets'
55
+ const servicePlugin = makeServicePlugin ({
56
+ Model: SpeedingTicket,
57
+ service: feathersClient .service (servicePath),
58
+ servicePath
54
59
})
55
60
56
61
feathersClient .service (servicePath)
You can’t perform that action at this time.
0 commit comments