File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ export const VueQueryPlugin = {
7777
7878 /* istanbul ignore next */
7979 if ( isVue2 ) {
80+ // Workaround for Vue2 calling mixin multiple times
81+ let devtoolsRegistered = false ;
8082 app . mixin ( {
8183 beforeCreate ( ) {
8284 // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30
@@ -87,10 +89,14 @@ export const VueQueryPlugin = {
8789 set : ( v ) => Object . assign ( provideCache , v ) ,
8890 } ) ;
8991 }
92+
9093 this . _provided [ clientKey ] = client ;
9194
92- if ( process . env . NODE_ENV === "development" ) {
93- setupDevtools ( this , client ) ;
95+ if ( ! devtoolsRegistered ) {
96+ if ( process . env . NODE_ENV === "development" ) {
97+ setupDevtools ( this , client ) ;
98+ devtoolsRegistered = true ;
99+ }
94100 }
95101 } ,
96102 } ) ;
You can’t perform that action at this time.
0 commit comments