import Vue from 'vue'
import singleSpaVue from 'single-spa-vue';
import App from './App.vue'
import store from './store'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/style.css'
import './assets/css/style.scss'
import './assets/iconfont/iconfont.css'
import '@/./permission-portal'
import {GetSealData, GetWebObj, SetSealData, SetSealDataEx, ShowSeal, WebSeal} from "@/utils/websign_main";

import './utils/G_websign.js'
// import './utils/Loadwebsign.js'
// import { WebSeal, GetSealData, GetWebObj, SetSealDataEx, SetSealData, ShowSeal } from '@/utils/websign_main.js'
import './utils/G_websign.css'
Vue.use(ElementUI)

Vue.prototype.$WebSeal = WebSeal
Vue.prototype.$GetSealData = GetSealData
Vue.prototype.$GetWebObj = GetWebObj
Vue.prototype.$SetSealDataEx = SetSealDataEx
Vue.prototype.$SetSealData = SetSealData
Vue.prototype.$ShowSeal = ShowSeal

Vue.config.productionTip = false;

const vueLifecycles = singleSpaVue({
    Vue,
    appOptions: {
        el: '#app4',
        router,
        store,
        render: h => h(App)
    }
});

export const bootstrap = [
    vueLifecycles.bootstrap,
];

export function mount(props) {
    createDomElement();
    return vueLifecycles.mount(props);
}

export const unmount = [
    vueLifecycles.unmount,
];

function createDomElement() {
    // Make sure there is a div for us to render into
    let el = document.getElementById('app4');

    if (!el) {
        let content = document.getElementById('content');
        el = document.createElement('div');
        el.id = 'app4';
        content.appendChild(el);
    }
    return el;
}