index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div>
  3. <div>
  4. <v-nav v-if="qq"></v-nav>
  5. </div>
  6. <div>
  7. <v-nav1 v-if="qq2"></v-nav1>
  8. </div>
  9. <!-- <div>
  10. <el-card>
  11. <v-nav2></v-nav2>
  12. </el-card>
  13. </div> -->
  14. </div>
  15. </template>
  16. <script>
  17. import navs from "@/views/index-frist";
  18. import navs1 from "@/views/index-list";
  19. import { EventBus } from '@/util/event-bus.js'
  20. import { getUserProfile } from "@/api/system/user";
  21. // import indexList from "./index";
  22. export default {
  23. data() {
  24. return {
  25. qq: false,
  26. qq2: true,
  27. user: {},
  28. };
  29. },
  30. components: {
  31. "v-nav": navs,
  32. "v-nav1": navs1,
  33. // "v-nav2": navs2,
  34. },
  35. created() {
  36. // var sscDomain = document.location.hostname;
  37. // getUserProfile(sscDomain).then((response) => {
  38. // this.user = response.data;
  39. // if (response.data.userName == "admin") {
  40. // this.qq = true;
  41. // this.qq2 = false;
  42. // } else {
  43. // this.qq = false;
  44. // this.qq2 = true;
  45. // }
  46. // });
  47. var children = [];
  48. this.$store.state.permission.routes.map((item) => {
  49. if (this.$route.matched[0] && item.alwaysShow && this.$route.matched[0].path == item.path) {
  50. children = item.children
  51. }
  52. });
  53. if(children && children.length != 0){
  54. EventBus.$emit('on-click-higher', {children: children, basepath: this.$route.matched[0].path})
  55. }
  56. },
  57. mounted() {},
  58. methods: {},
  59. };
  60. </script>