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 {
1111 App ,
1212 ComponentPublicInstance ,
1313 getCurrentInstance ,
14+ isVue3 ,
1415 onBeforeUnmount ,
1516 onUnmounted ,
1617 ref ,
@@ -171,15 +172,19 @@ export const firestorePlugin = function firestorePlugin(
171172 const globalOptions = Object . assign ( { } , defaultOptions , pluginOptions )
172173 const { bindName, unbindName } = globalOptions
173174
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 (
175180 key : string ,
176181 reset ?: FirestoreOptions [ 'reset' ]
177182 ) {
178183 internalUnbind ( key , firestoreUnbinds . get ( this ) , reset )
179184 delete this . $firestoreRefs [ key ]
180185 }
181186
182- app . config . globalProperties [ bindName ] = function firestoreBind (
187+ GlobalTarget [ bindName ] = function firestoreBind (
183188 this : ComponentPublicInstance ,
184189 key : string ,
185190 docOrCollectionRef :
You can’t perform that action at this time.
0 commit comments