Skip to content

Commit c6b838e

Browse files
committed
feat: add context for callback, close #53
1 parent 1ee3913 commit c6b838e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vue-2-breadcrumbs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
$breadcrumbs: {
55
get() {
66
const breadcrumbs = this.$route.matched.map(routeRecord => {
7-
let path = routeRecord.path.length ? routeRecord.path : '/';
7+
let path = routeRecord.path.length > 0 ? routeRecord.path : '/';
88
let route = routeRecord;
99

1010
Object.keys(this.$route.params).forEach(param => {
@@ -24,7 +24,7 @@ export default {
2424
const defaults = {
2525
methods: {
2626
getBreadcrumb: function (bc) {
27-
return typeof bc === 'function' ? bc(this.$route.params) : bc;
27+
return typeof bc === 'function' ? bc.call(this, this.$route.params) : bc;
2828
}
2929
},
3030
template: `

0 commit comments

Comments
 (0)