<template>
    <div class="m-page-header">
        <h3>
            <span class="glyphicon glyphicon-circle-arrow-left m-page-header-image"
                @click="goBack"
                 v-if="isGoBack == true || isGoBack == 'true'"></span>
            
            {{title}}
            
            <div class="pull-right">
                <slot></slot>
            </div>
        </h3>
    </div>
</template>

<script>

module.exports = {
    name: "Navbar",
    props: [
        //是否需要返回按钮,true:需要返回按钮，false:不需要返回按钮
        "isGoBack",
        //标题
        "title"
    ],

    data: function () {
        return {
            data: "",
        }
    },

    components: {

    },

    methods: {
        goBack: function () {
            history.back();
        }
    },
}
</script>

<style scoped>
.m-page-header {
    margin: 5px;
    padding: 0px;
    border-bottom: 1px solid #eee;
}

.m-page-header h3 {
    margin: 0px;
    padding: 5px 0px 5px 0px;
}

.m-page-header-image {
    top: 4px;
    cursor: pointer;
}
</style>