Skip to content

Commit

Permalink
feat: add context for callback, close #53
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrum committed Feb 6, 2019
1 parent 1ee3913 commit c6b838e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vue-2-breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
$breadcrumbs: {
get() {
const breadcrumbs = this.$route.matched.map(routeRecord => {
let path = routeRecord.path.length ? routeRecord.path : '/';
let path = routeRecord.path.length > 0 ? routeRecord.path : '/';
let route = routeRecord;

Object.keys(this.$route.params).forEach(param => {
Expand All @@ -24,7 +24,7 @@ export default {
const defaults = {
methods: {
getBreadcrumb: function (bc) {
return typeof bc === 'function' ? bc(this.$route.params) : bc;
return typeof bc === 'function' ? bc.call(this, this.$route.params) : bc;
}
},
template: `
Expand Down

0 comments on commit c6b838e

Please sign in to comment.