@@ -2,20 +2,19 @@ import { createApp } from "vue";
22import { createRouter , createWebHistory , createWebHashHistory } from "vue-router" ;
33import StacBrowser from "./StacBrowser.vue" ;
44import i18n , { loadDefaultMessages } from './i18n' ;
5- import CONFIG from './config' ;
65import getRoutes from "./router" ;
76import getStore from "./store" ;
87
98import { createBootstrap } from 'bootstrap-vue-next/plugins/createBootstrap' ;
109import { vBToggle } from 'bootstrap-vue-next/directives/BToggle' ;
1110import visible from './directives/visible' ;
1211
13- export default function init ( ) {
12+ export default function createStacBrowser ( config ) {
1413 return loadDefaultMessages ( ) . then ( ( ) => {
1514 // Setup router
1615 const router = createRouter ( {
17- history : CONFIG . historyMode === 'history' ? createWebHistory ( CONFIG . pathPrefix ) : createWebHashHistory ( CONFIG . pathPrefix ) ,
18- routes : getRoutes ( CONFIG ) ,
16+ history : config . historyMode === 'history' ? createWebHistory ( config . pathPrefix ) : createWebHashHistory ( config . pathPrefix ) ,
17+ routes : getRoutes ( config ) ,
1918 scrollBehavior : ( to , from , savedPosition ) => {
2019 if ( to . path !== from . path ) {
2120 return { left : 0 , top : 0 } ;
@@ -27,7 +26,7 @@ export default function init() {
2726 } ) ;
2827
2928 // Setup store
30- const store = getStore ( CONFIG , router ) ;
29+ const store = getStore ( config , router ) ;
3130
3231 const app = createApp ( StacBrowser ) ;
3332
@@ -42,6 +41,6 @@ export default function init() {
4241 app . use ( router ) ;
4342 app . use ( store ) ;
4443
45- return app . mount ( "body" ) ;
44+ return app ;
4645 } ) ;
4746}
0 commit comments