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

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