Blame view

src/utils/global.js 636 Bytes
c1b532ad   梁保满   权限配置,路由基础设置
1
2
  import rules from "./rules"
  import request from "@/api"
f45b3c05   LH_PC   云平台新UI界面
3
  import { Loading } from 'element-ui';
c1b532ad   梁保满   权限配置,路由基础设置
4
5
  
  export default {
f45b3c05   LH_PC   云平台新UI界面
6
    install(Vue, options) {
c1b532ad   梁保满   权限配置,路由基础设置
7
8
      Vue.prototype.$request = request
      Vue.prototype.$rules = rules
f45b3c05   LH_PC   云平台新UI界面
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
      Vue.prototype.$loading = {
        loading: null,
        open() {
          this.loading = Loading.service({
            lock: true,
            text: '加载中',
            spinner: 'el-icon-loading',
            background: 'rgba(0, 0, 0, 0.7)', 
            fullscreen: true
          });
        },
        close() {
          if (this.loading) {
            this.loading.close();
            this.loading = null;
          }
        }
      } 
c1b532ad   梁保满   权限配置,路由基础设置
27
28
    }
  }