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/iconfont/style.css'
import './assets/css/style.css'
// import './assets/css/style.scss'
import './assets/css/index.scss'
import VueQuillEditor from 'vue-quill-editor'

// require styles 引入样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { signature, preservSignature, signatureOnload } from '@/utils/H5Signature.js'
import './utils/layui.js'
Vue.use(VueQuillEditor)

import '@/permission'
Vue.use(ElementUI)

Vue.config.productionTip = false;

//签章new
Vue.prototype.$signature = signature
Vue.prototype.$preservSignature = preservSignature
Vue.prototype.$signatureOnload = signatureOnload
const vueLifecycles = singleSpaVue({
    Vue,
    appOptions: {
        el: '#accountability',
        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('accountability');

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