家政小程序
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.

main.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import Vue from 'vue';
  2. import iView from 'iview';
  3. import {Message,Modal} from 'iview';
  4. import {router} from './router/index';
  5. import {appRouter} from './router/router';
  6. import store from './store';
  7. import App from './app.vue';
  8. import '@/locale';
  9. import 'iview/dist/styles/iview.css';
  10. import VueI18n from 'vue-i18n';
  11. import util from '@/libs/util';
  12. import Login from '@/components/login';
  13. import Edit from '@/components/edit';
  14. Vue.use(VueI18n);
  15. Vue.use(iView);
  16. Vue.use(Login);
  17. Vue.use(Edit);
  18. Vue.prototype.$message = Message
  19. Vue.prototype.$Message = Message
  20. Vue.prototype.$Modal = Modal
  21. Vue.prototype.axios = util.ajax;
  22. Vue.prototype.$domain = util.ajaxUrl;
  23. new Vue({
  24. el: '#app',
  25. router: router,
  26. store: store,
  27. render: h => h(App),
  28. data: {
  29. currentPageName: ''
  30. },
  31. mounted () {
  32. this.currentPageName = this.$route.name;
  33. // 显示打开的页面的列表
  34. this.$store.commit('setOpenedList');
  35. this.$store.commit('initCachepage');
  36. // 权限菜单过滤相关
  37. this.$store.commit('updateMenulist');
  38. },
  39. created () {
  40. let tagsList = [];
  41. appRouter.map((item) => {
  42. if (item.children.length <= 1) {
  43. tagsList.push(item.children[0]);
  44. } else {
  45. tagsList.push(...item.children);
  46. }
  47. });
  48. this.$store.commit('setTagsList', tagsList);
  49. }
  50. });