From ccb0b834bbc17d3357d92635ae626970e0b67593 Mon Sep 17 00:00:00 2001 From: Mark von Zeschau Date: Mon, 29 Jan 2018 11:55:12 +0100 Subject: [PATCH] Make breadcrumbs dynamic, i.e. now they may be functions. In doing so it's possible to e.g. update the breadcrumbs when changing the language. --- src/vue-2-breadcrumbs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vue-2-breadcrumbs.js b/src/vue-2-breadcrumbs.js index 0b5253e..4955393 100644 --- a/src/vue-2-breadcrumbs.js +++ b/src/vue-2-breadcrumbs.js @@ -9,10 +9,15 @@ export default { }); Vue.component('breadcrumbs', { + methods: { + getBreadcrumb: function getBreadcrumb(bc) { + return typeof bc === 'function' ? bc() : bc + }, + }, template: ` `