top.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <el-row class='flex flex-align-center flex-justify-between top '>
  3. <el-col :span='12'>
  4. <div class='flex flex-justify-start flex-align-center light-green-bg'>
  5. <el-icon :size="20">
  6. <Filter />
  7. </el-icon>
  8. <el-breadcrumb class='ml-20' separator="/">
  9. <el-breadcrumb-item v-for='item in nav.menus' :key='item.id'>
  10. <a :href="item.path">{{ item.name }}</a>
  11. </el-breadcrumb-item>
  12. </el-breadcrumb>
  13. </div>
  14. </el-col>
  15. <el-col :span='12'>
  16. <div class='flex-child-average flex-justify-center flex padding-right light-green-bg'>
  17. <el-button @click='nav.cleanMenu()'>清除缓存</el-button>
  18. </div>
  19. </el-col>
  20. </el-row>
  21. </template>
  22. <script>
  23. import navStore from '../store/nav.js'
  24. export default {
  25. name: 'top',
  26. setup () {
  27. const nav = navStore()
  28. return { nav }
  29. },
  30. created () {
  31. this.nav.$subscribe((res) => {
  32. console.log(res.events.target)
  33. })
  34. }
  35. }
  36. </script>
  37. <style lang='scss' scoped>
  38. .top{
  39. height: 60px;
  40. z-index: 1;
  41. background-color: white;
  42. top: 0;
  43. left: 300px;
  44. right: 0;
  45. position: fixed;
  46. border-bottom: whitesmoke solid 1px;
  47. box-shadow: 0 5px 10px -5px rgba(0, 0, 0, 0.1);
  48. }
  49. </style>