index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!--
  2. * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
  3. * @Date: 2022-07-01 11:25:48
  4. * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
  5. * @LastEditTime: 2023-05-26 15:23:03
  6. * @FilePath: \agentManage\src\components\TopBar\index.vue
  7. * @Description:
  8. *
  9. * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
  10. -->
  11. <template>
  12. <div class="TopBar">
  13. <div class="title-box">
  14. <div class="line"></div>
  15. <div class="title">{{this.$route.meta.title}}</div>
  16. </div>
  17. <div>
  18. <el-button size="small" icon="el-icon-refresh" @click="handleRefresh">刷新</el-button>
  19. <el-button v-if="isBack" size="small" icon="el-icon-arrow-left" @click="handleBack">返回</el-button>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. export default {
  25. name:'TopBar',
  26. props: {
  27. title: {
  28. type: String,
  29. default: ''
  30. },
  31. isBack: {
  32. type: Boolean,
  33. default: false
  34. },
  35. },
  36. methods: {
  37. handleRefresh() {
  38. this.$emit('refresh')
  39. window.location.reload()
  40. },
  41. handleBack(){
  42. this.$router.go(-1)
  43. }
  44. },
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .TopBar{
  49. line-height: 50px;
  50. padding: 0 10px;
  51. display: flex;
  52. justify-content: space-between;
  53. align-items: center;
  54. background: #F3F3F3;
  55. margin-bottom: 20px;
  56. .title-box{
  57. display: flex;
  58. align-items: center;
  59. .line{
  60. width: 5px;
  61. height: 16px;
  62. background: #1abc9c;
  63. }
  64. .title{
  65. font-size: 14px;
  66. color: #666;
  67. font-weight: 600;
  68. margin-left: 3px;
  69. }
  70. }
  71. }
  72. </style>