<template>
  <div class="py-breadcrumb" aria-label="Breadcrumb" role="navigation">
    <slot></slot>
    <!--这里的slot是是包含在py-breadcrumb全部内容-->
  </div>
</template>

<script>
export default {
  name: "PyBreadcrumb",

  props: {
    separator: {
      type: String,
      default: "/"
    },
    separatorClass: {
      type: String,
      default: ""
    }
  },
  provide() {
    return {
      PyBreadcrumb: this
    };
  },
  mounted() {
    const items = this.$el.querySelectorAll(".py-breadcrumb__item");
    console.log(items);
    if (items.length) {
      items[items.length - 1].setAttribute("aria-current", "page");
    }
  }
};
</script>