main.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import Vue from 'vue'
  2. import ElementUI from 'element-ui'
  3. import App from './App.vue'
  4. import router from './router'
  5. import store from '@/store'
  6. import 'element-ui/lib/theme-chalk/index.css'
  7. import '@/styles/index.scss' // global css
  8. import './icons' // icon
  9. import './router/permission' // permission control
  10. import vueWaves from '@/directive/waves'
  11. import locale from 'element-ui/lib/locale/lang/en'
  12. import {baseURL} from './http/http'
  13. Vue.use(ElementUI, { locale })
  14. Vue.use(vueWaves)
  15. Vue.prototype.$openRoute = (route, isResult) => {
  16. let sharpe = "#"
  17. if (route.indexOf("/") !== 0) {
  18. sharpe += "/";
  19. }
  20. if (isResult) {
  21. window.open(location.origin + location.pathname + sharpe + route, "_blank", "status=no,location=no,menubar=no,toolbar=no,left=200");
  22. } else {
  23. window.open(location.origin + location.pathname + sharpe + route);
  24. }
  25. }
  26. Vue.prototype.$imageSrc = (url) => {
  27. if (url.indexOf('http') >= 0) {
  28. return url;
  29. } else {
  30. return baseURL + url;
  31. }
  32. }
  33. new Vue({
  34. el: '#app',
  35. router,
  36. store,
  37. render: h => h(App)
  38. })