Skip to content

Commit

Permalink
style: according eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrum committed Apr 29, 2018
1 parent 0172a29 commit ee62a28
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/vue-2-breadcrumbs.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
export default {
install (Vue) {
install(Vue) {
Object.defineProperties(Vue.prototype, {
$breadcrumbs: {
get () {
get() {
return this.$route.matched.map(r => {
let path = ''
let route = r
let path = '';
let route = r;

Object.keys(this.$route.params).map(e => {
path = route.path.replace(':' + e, this.$route.params[e])
}, this)
route.path = path
return route
}, this)
Object.keys(this.$route.params).forEach(e => {
path = route.path.replace(':' + e, this.$route.params[e]);
}, this);
route.path = path;
return route;
}, this);
}
}
})
});

Vue.component('breadcrumbs', {
methods: {
getBreadcrumb: function (bc) {
return typeof bc === 'function' ? bc(this.$route.params) : bc
return typeof bc === 'function' ? bc(this.$route.params) : bc;
}
},
template: `
Expand All @@ -30,6 +30,6 @@ export default {
</li>
</ol>
`
})
});
}
}
};

0 comments on commit ee62a28

Please sign in to comment.