Skip to content

Commit 478b42b

Browse files
committed
Enable this.$FeathersVuex models in components
https://feathers-plus.github.io/v1/feathers-vuex/model-classes.html
1 parent f25bbf9 commit 478b42b

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

nuxt.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ module.exports = {
9797
{src: '~/plugins/debug.js', ssr: false},
9898
{src: '~/plugins/raven-client.js', ssr: false},
9999
{src: '~/plugins/api.js'},
100+
{src: '~/plugins/feathers-vuex.js'},
100101
{src: '~/plugins/vue-directives.js', ssr: false},
101102
{src: '~/plugins/init-store-subscriptions.js', ssr: false},
102103
{src: '~/plugins/keep-alive.js', ssr: false},

plugins/feathers-vuex.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Vue from 'vue'
2+
import Vuex from 'vuex'
3+
import feathersVuex from 'feathers-vuex'
4+
import feathersClient from '../feathers-client'
5+
// Get a reference to the FeathersVuex plugin
6+
const { service, auth, FeathersVuex } = feathersVuex(feathersClient, { idField: '_id' })
7+
// Register the plugin with Vue.
8+
Vue.use(FeathersVuex)
9+
Vue.use(Vuex)
10+
export default new Vuex.Store({
11+
plugins: [
12+
service('usersettings')
13+
]
14+
})

0 commit comments

Comments
 (0)