<template><div>
<a-breadcrumb class="breadcrumb">
    <a-breadcrumb-item v-for="(item, index) in tbreadList" :key="index">
      <span >{{ item.meta.title }}</span>
    </a-breadcrumb-item>
  </a-breadcrumb>
</div>

</template>

<script>
export default {
  data() {
    return {
      name: '',
      tbreadList: [],
    }
  },
  mounted() {
    this.getBreadcrumb()
  },
  methods: {
    getBreadcrumb() {
      let breadList = []
      for (let i = 1; i < this.$route.matched.length; i++){
        let item=this.$route.matched[i]
        if(i===1){
          breadList.push({name:'home',path:'/home',meta:{title:this.$lang('首页')}})
        }else{
          breadList.push(item)
        }
      }
      this.tbreadList=breadList

    },
  },
  watch: {
    $route(value, olo) {
      this.getBreadcrumb()
    },
  },
}
</script>

<style scoped>
</style>
