Swap global vars to app config as JSON
This commit is contained in:
+6
-5
@@ -9,7 +9,6 @@ window.setElem = common.setElem;
|
||||
window.getDragPosition = common.getDragPosition;
|
||||
window.copyTextToClipboard = common.copyTextToClipboard;
|
||||
window.getOuterWidth = common.getOuterWidth;
|
||||
|
||||
import Css from './../styles/spot.scss';
|
||||
|
||||
//Masks
|
||||
@@ -18,8 +17,6 @@ import Spot from './spot.js';
|
||||
//import Upload from './page.upload.js';
|
||||
//import Admin from './page.admin.js';
|
||||
|
||||
window.oSpot = new Spot(params);
|
||||
|
||||
//let oProject = new Project(oSpot);
|
||||
//oSpot.addPage('project', oProject);
|
||||
|
||||
@@ -34,6 +31,10 @@ window.oSpot = new Spot(params);
|
||||
import { createApp } from 'vue';
|
||||
import SpotVue from '../Spot.vue';
|
||||
|
||||
const appConfigElement = document.getElementById('app-config');
|
||||
const appConfig = appConfigElement ? JSON.parse(appConfigElement.textContent || '{}') : {};
|
||||
const oSpot = new Spot(appConfig);
|
||||
|
||||
const oSpotVue = createApp(SpotVue);
|
||||
oSpotVue.provide('spot', window.oSpot);
|
||||
oSpotVue.mount('#container');
|
||||
oSpotVue.provide('spot', oSpot);
|
||||
oSpotVue.mount('#container');
|
||||
|
||||
Reference in New Issue
Block a user