merchant-web/src/main.js

102 lines
3.2 KiB
JavaScript
Raw Normal View History

2024-08-05 08:26:35 +00:00
/*
* @Author: ym
* @Date: 2021-09-28 10:53:53
* @LastEditTime: 2022-08-19 11:05:59
* @LastEditors: 陈伟亮 1186723967@qq.com
* @Description: In User Settings Edit
* @FilePath: \background-front-end\src\main.js
*/
import Vue from 'vue'
import App from '@/App'
import router from '@/router' // api: https://github.com/vuejs/vue-router
import store from '@/store' // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie' // api: https://github.com/alfhen/vue-cookie
import ElementUI from 'element-ui'; // api: https://github.com/ElemeFE/element
import meta from 'vue-meta'
import "./style/tailwindcss.css";
import 'element-ui/lib/theme-chalk/index.css';
import '@/icons' // api: http://www.iconfont.cn/
import '@/utils/plugins'
import '@/assets/scss/index.scss'
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
import { isAuth } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
import $api from '@/api/index.js'
import AMap from 'vue-amap';
import { exportExcel } from './utils/xlsx'
import microApp from '@micro-zoe/micro-app'
microApp.start()
// 全局组件自动注册
import '@/components/form/autoRegister'
Vue.use(meta)
Vue.use(AMap);
// 初始化vue-amap
AMap.initAMapApiLoader({
// 高德key
key: ' 27b3e6d38f40c186deef9ee1766678af',
// 插件集合 (插件按需引入)
//此处使用双引号报错
plugin: ['AMap.ToolBar', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder']
});
// import $ from 'jquery'
// 全局组件自动注册
// import '@/components/autoRegister'
Vue.use(ElementUI);
Vue.prototype.$exportExcel=exportExcel
Vue.prototype.$newSource='大妈集市商户端'//资讯来源默认值
Vue.prototype.$uploadUrl=`${window.SITE_CONFIG['baseUrl']}/sys/oss/upload2`
//通用工具类
import commonUtil from './utils/common'
Vue.prototype.commonUtil = commonUtil;
//常量和数据字典
import commonConstants from './utils/constants'
Vue.prototype.commonConstants = commonConstants;
//搜索数据
import selectUtil from './utils/selectValue'
Vue.prototype.selectUtil = selectUtil;
import modal from './components/common/modal/modal'
Vue.use(modal)
//表单校验
import validate from './utils/validate/validate'
Vue.use(validate);
Vue.use(VueCookie)
Vue.config.productionTip = false
// 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock
if (process.env.NODE_ENV !== 'production') {
require('@/mock')
}
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
Vue.use(VXETable)
import objTablePlus from 'obj-table-plus';
Vue.use(objTablePlus);
import objModal from 'obj-modal'
Vue.use(objModal)
import AsyncComputed from 'vue-async-computed'
Vue.use(AsyncComputed);
import Contextmenu from "vue-contextmenujs"
Vue.use(Contextmenu);
// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth // 权限方法
Vue.prototype.$api=$api
// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
import "video.js/dist/video-js.css"
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
template: '<App/>',
components: { App }
})