if (!!window.ActiveXObject || 'ActiveXObject' in window) {
    alert('本系统不支持ie，请使用Chrome、Firefox、Edge等现代浏览器访问！');
    reutrn;
}

// 基础框架
import moohoBaseAdmin, { Vue, App, router, store, i18n, created, routeChanged } from '../src/index.js';

// 固定路由
import routes from './router/routes';
import { frameInRoutes } from './router/routes';

// 布局
import layout from './layout';

// 自定义css
import './styles/css/wms.css';

// 页面
const files = require.context('./pages', true, /\.vue$/);
const pages = {};

files.keys().forEach(key => {
    pages[key.replace(/(\.\/)/g, '')] = files(key).default;
});

Vue.use(moohoBaseAdmin);

new Vue({
    router,
    store,
    i18n,
    render: h => h(App),
    async created() {
        routes.forEach(route => {
            router.addRoute(route);
        });
        created(frameInRoutes, pages, layout);
    },
    watch: {
        // 监听路由
        $route: (to, from) => {
            routeChanged(to, from);
        }
    }
}).$mount('#app');
