import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import directives from '@/directives' // 自定义指令集
//import 'default-passive-events'
import '@/services/subscribe' // 全局订阅通知
import '@/mock' // 模拟数据
import '@/utils/h5plus' // 加载html5+
import client from '@/utils/client' // 适配客户端
import layouts from './components/layouts' // 全局布局组件
import './assets/iconfont/iconfont.js'
import './assets/themes/style.less' // 主题样式
import { timerInterceptor } from '@/utils/timer'
// import Vconsole from 'vconsole'
// new Vconsole();

const app = createApp(App)
app.use(router)
app.use(directives)
app.use(layouts)
app.mount('#app')

// 等待 html 加载完成
document.addEventListener('DOMContentLoaded', () => {
    client.screenAdapter(true);
    // 监听窗口大小变化
    window.addEventListener('resize', timerInterceptor.setDebounce(() => client.screenAdapter(true)));
}, false)