@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
53 lines (52 loc) • 1.56 kB
JavaScript
import { defineComponent as r, ref as a, onMounted as i, nextTick as s } from "vue";
import c from "../../presentation/icon/NeonIcon.vue.es.js";
import l from "../link/NeonLink.vue.es.js";
import u from "../../layout/swiper/NeonSwiper.vue.es.js";
import { NeonBreadcrumbResponsiveStyle as m } from "../../../model/navigation/breadcrumbs/NeonBreadcrumbResponsiveStyle.es.js";
const k = r({
name: "NeonBreadcrumbs",
components: { NeonIcon: c, NeonLink: l, NeonSwiper: u },
props: {
/**
* The list of breadcrumbs to display.
*/
breadcrumbs: { type: Array, default: () => [] },
/**
* Whether to display the back button.
*/
backButton: { type: Boolean, default: !0 },
/**
* The label override for the back button.
*/
backLabel: { type: String, default: "Back" },
/**
* The responsive style (mobile-large breakpoint), either place in a swiper or display a larger back button & no
* breadcrumbs.
*/
responsiveStyle: {
type: String,
default: m.Swiper
}
},
setup(o) {
const e = a(null), n = async () => history.back();
return i(async () => {
o.breadcrumbs.length > 0 && (await s(), setTimeout(() => {
if (e.value) {
const t = e.value.querySelector(".neon-link:last-child");
t == null || t.scrollIntoView({
behavior: "auto",
inline: "end"
});
}
}));
}), {
back: n,
linksRef: e
};
}
});
export {
k as default
};
//# sourceMappingURL=NeonBreadcrumbs.es.js.map