Commit 69aeb7b42d292ff2d109af4f5f4ad52f54a94ee4
1 parent
bbe194b0
新增全局$message
Showing
1 changed file
with
36 additions
and
36 deletions
src/main.js
| 1 | -import Vue from 'vue' | |
| 1 | +import Vue from "vue"; | |
| 2 | 2 | |
| 3 | 3 | // element-ui |
| 4 | -import ElementUI from 'element-ui' | |
| 5 | -import 'element-ui/lib/theme-chalk/index.css' | |
| 6 | -import zhLocale from 'element-ui/lib/locale/lang/zh-CN' | |
| 7 | -import 'normalize.css/normalize.css'// A modern alternative to CSS resets | |
| 8 | -import '@/assets/styles/common.css' | |
| 9 | -import '@/assets/styles/index.scss'// custome global css | |
| 4 | +import ElementUI from "element-ui"; | |
| 5 | +import "element-ui/lib/theme-chalk/index.css"; | |
| 6 | +import zhLocale from "element-ui/lib/locale/lang/zh-CN"; | |
| 7 | +import "normalize.css/normalize.css"; // A modern alternative to CSS resets | |
| 8 | +import "@/assets/styles/common.css"; | |
| 9 | +import "@/assets/styles/index.scss"; // custome global css | |
| 10 | 10 | |
| 11 | 11 | // app router vuex filter mixins |
| 12 | -import App from './App' | |
| 13 | -import router from './router' | |
| 14 | -import store from './store' | |
| 15 | -import * as filter from './filter' | |
| 16 | -import mixins from '@/mixins' | |
| 17 | -import echarts from 'echarts'; | |
| 12 | +import App from "./App"; | |
| 13 | +import router from "./router"; | |
| 14 | +import store from "./store"; | |
| 15 | +import * as filter from "./filter"; | |
| 16 | +import mixins from "@/mixins"; | |
| 17 | +import echarts from "echarts"; | |
| 18 | 18 | // 全局定义echarts |
| 19 | -import ECharts from 'vue-echarts' | |
| 20 | -import 'echarts/lib/chart/bar' | |
| 21 | -import 'echarts/lib/component/tooltip' | |
| 19 | +import ECharts from "vue-echarts"; | |
| 20 | +import "echarts/lib/chart/bar"; | |
| 21 | +import "echarts/lib/component/tooltip"; | |
| 22 | 22 | //import 'echarts-liquidfill' |
| 23 | 23 | // import 'echarts-gl' |
| 24 | -Vue.component('v-chart', ECharts) | |
| 24 | +Vue.component("v-chart", ECharts); | |
| 25 | 25 | |
| 26 | 26 | // anji component |
| 27 | -import anjiCrud from '@/components/AnjiPlus/anji-crud/anji-crud' | |
| 28 | -import anjiSelect from '@/components/AnjiPlus/anji-select' | |
| 29 | -import anjiUpload from '@/components/AnjiPlus/anji-upload' | |
| 30 | -Vue.component('anji-upload', anjiUpload) | |
| 31 | -Vue.component('anji-crud', anjiCrud) | |
| 32 | -Vue.component('anji-select', anjiSelect) | |
| 27 | +import anjiCrud from "@/components/AnjiPlus/anji-crud/anji-crud"; | |
| 28 | +import anjiSelect from "@/components/AnjiPlus/anji-select"; | |
| 29 | +import anjiUpload from "@/components/AnjiPlus/anji-upload"; | |
| 30 | +Vue.component("anji-upload", anjiUpload); | |
| 31 | +Vue.component("anji-crud", anjiCrud); | |
| 32 | +Vue.component("anji-select", anjiSelect); | |
| 33 | 33 | |
| 34 | 34 | // permission control |
| 35 | -import '@/permission' | |
| 35 | +import "@/permission"; | |
| 36 | 36 | // 按钮权限的指令 |
| 37 | -import permission from '@/components/Permission/index' | |
| 38 | -Vue.use(permission) | |
| 37 | +import permission from "@/components/Permission/index"; | |
| 38 | +Vue.use(permission); | |
| 39 | 39 | |
| 40 | -import Avue from '@smallwei/avue'; | |
| 41 | -import '@smallwei/avue/lib/index.css'; | |
| 40 | +import Avue from "@smallwei/avue"; | |
| 41 | +import "@smallwei/avue/lib/index.css"; | |
| 42 | 42 | Vue.use(Avue); |
| 43 | 43 | |
| 44 | 44 | // enable element zh-cn |
| 45 | -Vue.use(ElementUI, { zhLocale }) | |
| 45 | +Vue.use(ElementUI, { zhLocale }); | |
| 46 | +Vue.prototype.$message = ElementUI.Message; | |
| 46 | 47 | |
| 47 | 48 | // register global filter. |
| 48 | 49 | Object.keys(filter).forEach(key => { |
| 49 | - Vue.filter(key, filter[key]) | |
| 50 | -}) | |
| 50 | + Vue.filter(key, filter[key]); | |
| 51 | +}); | |
| 51 | 52 | |
| 52 | 53 | // register global mixins. |
| 53 | -Vue.mixin(mixins) | |
| 54 | - | |
| 54 | +Vue.mixin(mixins); | |
| 55 | 55 | |
| 56 | 56 | // 分页的全局size配置; |
| 57 | -Vue.prototype.$pageSizeAll = [10, 50, 100, 200, 500] | |
| 57 | +Vue.prototype.$pageSizeAll = [10, 50, 100, 200, 500]; | |
| 58 | 58 | |
| 59 | -Vue.config.productionTip = false | |
| 59 | +Vue.config.productionTip = false; | |
| 60 | 60 | |
| 61 | 61 | // create the app instance. |
| 62 | -new Vue({ el: '#app', router, store, render: h => h(App) }) | |
| 62 | +new Vue({ el: "#app", router, store, render: h => h(App) }); | ... | ... |