File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
App ,
12
12
ComponentPublicInstance ,
13
13
getCurrentInstance ,
14
+ isVue3 ,
14
15
onBeforeUnmount ,
15
16
onUnmounted ,
16
17
ref ,
@@ -171,15 +172,19 @@ export const firestorePlugin = function firestorePlugin(
171
172
const globalOptions = Object . assign ( { } , defaultOptions , pluginOptions )
172
173
const { bindName, unbindName } = globalOptions
173
174
174
- app . config . globalProperties [ unbindName ] = function firestoreUnbind (
175
+ const GlobalTarget = isVue3
176
+ ? app . config . globalProperties
177
+ : ( app as any ) . prototype
178
+
179
+ GlobalTarget [ unbindName ] = function firestoreUnbind (
175
180
key : string ,
176
181
reset ?: FirestoreOptions [ 'reset' ]
177
182
) {
178
183
internalUnbind ( key , firestoreUnbinds . get ( this ) , reset )
179
184
delete this . $firestoreRefs [ key ]
180
185
}
181
186
182
- app . config . globalProperties [ bindName ] = function firestoreBind (
187
+ GlobalTarget [ bindName ] = function firestoreBind (
183
188
this : ComponentPublicInstance ,
184
189
key : string ,
185
190
docOrCollectionRef :
You can’t perform that action at this time.
0 commit comments