<template>
  <header class="header bar bar-nav">
    <a href="javascript:;" class="icon icon-prev" @click="handlePrevPageClick" v-if="isShowPrevPage"></a>
    <div class="title"><slot name="title">{{ title }}</slot></div>
    <slot name="action"></slot>
  </header>
</template>

<script>
export default {
    name: 'VHeader',
    props: {
        title: {
            type: String,
            default: ''
        },
        isShowPrevPage: {
            type: Boolean,
            default: true
        }
    },
    methods: {
        handlePrevPageClick () {
            this.$router.go(-1)
        }
    }
}
</script>

<style lang="less" scoped>
</style>
