Skip to content

Commit d3579ed

Browse files
committed
fix: augment GlobalModels onto VueConstructor and Vue instance
1 parent 9a45916 commit d3579ed

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ const defaults: FeathersVuexOptions = {
5353
whitelist: [] // Custom query operators that will be allowed in the find getter.
5454
}
5555

56-
// Augment global models onto VueConstructor
57-
declare module 'vue' {
58-
interface VueConstructor {
59-
$FeathersVuex: FeathersVuexGlobalModels
60-
}
61-
}
62-
6356
export default function feathersVuex(feathers, options: FeathersVuexOptions) {
6457
if (!feathers || !feathers.service) {
6558
throw new Error(

src/vue-plugin/vue-plugin.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ import FeathersVuexFormWrapper from '../FeathersVuexFormWrapper'
99
import FeathersVuexInputWrapper from '../FeathersVuexInputWrapper'
1010
import FeathersVuexPagination from '../FeathersVuexPagination'
1111
import { globalModels } from '../service-module/global-models'
12+
import { FeathersVuexGlobalModels } from '../service-module/types'
13+
14+
// Augment global models onto VueConstructor and instance
15+
declare module 'vue/types/vue' {
16+
interface VueConstructor {
17+
$FeathersVuex: FeathersVuexGlobalModels
18+
}
19+
interface Vue {
20+
$FeathersVuex: FeathersVuexGlobalModels
21+
}
22+
}
1223

1324
export const FeathersVuex = {
1425
install(Vue, options = { components: true }) {

0 commit comments

Comments
 (0)