BreadcrumbBar.vue 1.06 KB
<template>
    <a-breadcrumb class="ant-breadcrumb" v-if="this.$route.path!=='/dashboard'&&this.$route.path!=='/finance/dashboard'">
        <a-breadcrumb-item>
            <router-link to="/dashboard">
                <HomeOutlined/>
            </router-link>

        </a-breadcrumb-item>
        <a-breadcrumb-item v-for="item in breadcrumb" :key="item.name">
            <template v-if="item.path">
                <router-link :to="item.path">
                    {{ item.name }}
                </router-link>
            </template>
            <template v-else>
                {{ item.name }}
            </template>
        </a-breadcrumb-item>
    </a-breadcrumb>
</template>

<script lang="ts">


import {Component, Vue} from "vue-facing-decorator";
import {HomeOutlined} from "@ant-design/icons-vue";

@Component({
    components: {HomeOutlined}
})
export default class BreadcrumbBar extends Vue {

    get breadcrumb() {
        return this.$route.meta.breadcrumbs;
    }
}
</script>

<style lang="less" scoped>
.ant-breadcrumb {
    padding: 9px 20px 1px 20px;
}
</style>