Skip to content

Commit 88f3da2

Browse files
committed
feat: add options for overwriting default configure close #44 close #47
1 parent 8d53a66 commit 88f3da2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/vue-2-breadcrumbs.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default {
2-
install(Vue) {
2+
install(Vue, options) {
33
Object.defineProperties(Vue.prototype, {
44
$breadcrumbs: {
55
get() {
@@ -21,7 +21,7 @@ export default {
2121
}
2222
});
2323

24-
Vue.component('breadcrumbs', {
24+
const defaults = {
2525
methods: {
2626
getBreadcrumb: function (bc) {
2727
return typeof bc === 'function' ? bc(this.$route.params) : bc;
@@ -34,6 +34,8 @@ export default {
3434
</li>
3535
</ol>
3636
`
37-
});
37+
};
38+
39+
Vue.component('breadcrumbs', Object.assign(defaults, options));
3840
}
3941
};

0 commit comments

Comments
 (0)