<!--
 * @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: wj 1454560336@qq.com
 * @LastEditTime: 2023-11-21 18:44:40
 * @FilePath: \admin-manage\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.query.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>
@import '../../styles/element-variables';
.TopBar{
    line-height: 50px;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    margin-bottom: 20px;
    border-radius: 4px;
    .title-box{
        display: flex;
        align-items: center;
        .line{
            width: 5px;
            height: 16px;
            background: $--color-primary;
            color: $--color-primary;
        }
        .title{
            font-size: 14px;
            color: $--color-primary;
            font-weight: 600;
            margin-left: 3px;
        }
    }

}
</style>