You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.6 KiB
49 lines
1.6 KiB
import { createApp } from 'vue' |
|
import ElementPlus from 'element-plus'; |
|
import 'dayjs/locale/zh-cn' |
|
import locale from 'element-plus/lib/locale/lang/zh-cn' |
|
import 'element-plus/lib/theme-chalk/index.css'; |
|
import './assets/icons' |
|
import App from './App.vue'; |
|
import router from './router'; |
|
import store from './store'; |
|
import '@/assets/css/base.css'; |
|
import '@/assets/css/style.css'; |
|
import { mixins } from "@/mixins/mixins"; |
|
import VueWechatTitle from 'vue-wechat-title' |
|
import { jsSeamlessScroll } from "vue3-seamless-scroll"; |
|
import 'vant/lib/index.css'; |
|
import SvgIcon from '@/components/SvgIcon' |
|
|
|
const app = createApp(App) |
|
|
|
// 全局注册组件 |
|
app.component('svg-icon', SvgIcon) |
|
// 定义一个加载目录的函数 |
|
const requireAll = requireContext => requireContext.keys().map(requireContext) |
|
const req = require.context('@/assets/icons', false, /\.svg$/) |
|
// 加载目录下的所有 svg 文件 |
|
requireAll(req) |
|
|
|
app.use(store) |
|
app.use(router) |
|
app.use(ElementPlus, { locale }) |
|
app.mixin(mixins) |
|
app.use(VueWechatTitle) |
|
app.use(jsSeamlessScroll) |
|
app.mount('#app') |
|
router.afterEach(() => { |
|
setTimeout(() => { |
|
//百度统计 |
|
var _hmt = _hmt || []; |
|
(function () { |
|
//每次执行前,先移除上次插入的代码 |
|
document.getElementById('baidu_tj') && document.getElementById('baidu_tj').remove(); |
|
var hm = document.createElement("script"); |
|
hm.src = "https://hm.baidu.com/hm.js?f4d7d83c565e698bd7cedfe9c6297055"; |
|
hm.id = "baidu_tj" |
|
var s = document.getElementsByTagName("script")[0]; |
|
s.parentNode.insertBefore(hm, s); |
|
})(); |
|
}, 0); |
|
});
|
|
|