@@ -6,14 +6,15 @@ import Appbase from 'appbase-js';
66import AppbaseAnalytics from '@appbaseio/analytics' ;
77import 'url-search-params-polyfill' ;
88import { createCache } from '@appbaseio/vue-emotion' ;
9+ import { defineComponent } from 'vue' ;
910import Provider from '../Provider' ;
1011import { composeThemeObject , X_SEARCH_CLIENT } from '../../utils/index' ;
1112import types from '../../utils/vueTypes' ;
1213import URLParamsProvider from '../URLParamsProvider.jsx' ;
1314import getTheme from '../../styles/theme' ;
1415
1516const { setValues } = Actions ;
16- const ReactiveBase = {
17+ const ReactiveBase = defineComponent ( {
1718 name : 'ReactiveBase' ,
1819 data ( ) {
1920 this . state = {
@@ -109,10 +110,10 @@ const ReactiveBase = {
109110 ...( enableTelemetry === false && { 'X-Enable-Telemetry' : false } ) ,
110111 } ) ,
111112 ...headers ,
112- ...( endpoint &&
113- endpoint . headers && {
114- ...endpoint . headers ,
115- } ) ,
113+ ...( endpoint
114+ && endpoint . headers && {
115+ ...endpoint . headers ,
116+ } ) ,
116117 } ;
117118 } ,
118119 } ,
@@ -122,8 +123,8 @@ const ReactiveBase = {
122123 this . key = `${ this . state . key } -0` ;
123124 } ,
124125 setStore ( props ) {
125- const credentials =
126- props . url && props . url . trim ( ) !== '' && ! props . credentials
126+ const credentials
127+ = props . url && props . url . trim ( ) !== '' && ! props . credentials
127128 ? null
128129 : props . credentials ;
129130 let url = props . url && props . url . trim ( ) !== '' ? props . url : '' ;
@@ -208,8 +209,8 @@ const ReactiveBase = {
208209 // When endpoint prop is used index is not defined, so we use _default
209210 index : appbaseRef . app || '_default' ,
210211 globalCustomEvents :
211- this . $props . reactivesearchAPIConfig &&
212- this . $props . reactivesearchAPIConfig . customEvents ,
212+ this . $props . reactivesearchAPIConfig
213+ && this . $props . reactivesearchAPIConfig . customEvents ,
213214 } ;
214215
215216 try {
@@ -219,13 +220,13 @@ const ReactiveBase = {
219220 / \/ \/ ( .* ?) \/ .* / ,
220221 '//$1' ,
221222 ) ;
222- const headerCredentials =
223- this . $props . endpoint . headers && this . $props . endpoint . headers . Authorization ;
224- analyticsInitConfig . credentials =
225- headerCredentials && headerCredentials . replace ( 'Basic ' , '' ) ;
223+ const headerCredentials
224+ = this . $props . endpoint . headers && this . $props . endpoint . headers . Authorization ;
225+ analyticsInitConfig . credentials
226+ = headerCredentials && headerCredentials . replace ( 'Basic ' , '' ) ;
226227 // Decode the credentials
227- analyticsInitConfig . credentials =
228- analyticsInitConfig . credentials && atob ( analyticsInitConfig . credentials ) ;
228+ analyticsInitConfig . credentials
229+ = analyticsInitConfig . credentials && atob ( analyticsInitConfig . credentials ) ;
229230 }
230231 } catch ( e ) {
231232 console . error ( 'Endpoint not set correctly for analytics' ) ;
@@ -271,6 +272,7 @@ const ReactiveBase = {
271272 render ( ) {
272273 const children = this . $slots . default ;
273274 const { style, className } = this . $props ;
275+ window . console . log ( '🚀 ~ file: pppppppp' ) ;
274276 return (
275277 < Provider store = { this . store } analyticsRef = { this . analyticsRef } >
276278 < URLParamsProvider
@@ -287,7 +289,7 @@ const ReactiveBase = {
287289 </ Provider >
288290 ) ;
289291 } ,
290- } ;
292+ } ) ;
291293ReactiveBase . install = function ( Vue ) {
292294 Vue . component ( ReactiveBase . name , ReactiveBase ) ;
293295} ;
0 commit comments