<template>
    <div class="public-title">
        <div class="left">
            <img class="left-icon" :src="iconUrl" />
            <div class="right-title" @click="skipPage" title="点击跳转">{{ title }}</div>
        </div>
        <slot></slot>
    </div>
</template>

<script>
export default {
    name: 'PublicTitle', // 公共标题
    props: {
        iconUrl: {
            type: String,
            default: '',
        },
        title: {
            type: String,
            default: '',
        },
        routerPath: {
            type: String,
            default: '',
        },
    },
    data() {
        return {}
    },
    created() { },
    methods: {
        skipPage() {
            this.$router.push(this.routerPath)
        }
    },
}
</script>

<style scoped lang="scss">
.public-title {
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #e2eaf3;

    .left {
        display: flex;
        align-items: center;
        .left-icon {
            width: 16px;
            height: 16px;
        }

        .right-title {
            cursor: pointer;
            font-size: 18px;
            font-weight: 700;
            color: #1150a0;
            margin-left: 6px;
        }
    }

}
</style>
