<!--
 * @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
 * @Date: 2022-07-01 11:25:48
 * @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
 * @LastEditTime: 2023-05-26 15:23:03
 * @FilePath: \agentManage\src\components\TopBar\index.vue
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
-->
<template>
    <div class="TopBar">
        <div class="title-box">
            <div class="line"></div>
            <div class="title">{{this.$route.meta.title}}</div>
        </div>
        <div>

        <el-button size="small" icon="el-icon-refresh" @click="handleRefresh">刷新</el-button>
        <el-button v-if="isBack" size="small" icon="el-icon-arrow-left" @click="handleBack">返回</el-button>
        </div>
    </div>
</template>

<script>
    export default {
        name:'TopBar',
        props: {
            title: {
                type: String,
                default: ''
            },
            isBack: {
                type: Boolean,
                default: false
            },
        },
        methods: {
            handleRefresh() {
                this.$emit('refresh')
                window.location.reload()
            },
            handleBack(){
                this.$router.go(-1)
            }
        },
    }
</script>

<style lang="scss" scoped>
.TopBar{
    line-height: 50px;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F3F3F3;
    margin-bottom: 20px;
    .title-box{
        display: flex;
        align-items: center;
        .line{
            width: 5px;
            height: 16px;
            background: #1abc9c;
        }
        .title{
            font-size: 14px;
            color: #666;
            font-weight: 600;
            margin-left: 3px;
        }
    }

}
</style>