Skip to content

Commit

Permalink
fix(MdBottomBarItem): missing props to for router link (#1531)
Browse files Browse the repository at this point in the history
fix #1412
  • Loading branch information
VdustR authored and marcosmoura committed Feb 20, 2018
1 parent 09030c6 commit 6860d3a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/components/MdBottomBar/MdBottomBarItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:id="id"
:disabled="mdDisabled"
:md-ripple="MdBottomBar.type === 'fixed'"
v-bind="$attrs"
v-bind="attrs"
v-on="$listeners"
@click="setActiveItem">
<slot v-if="$slots.default"></slot>
Expand Down Expand Up @@ -58,6 +58,18 @@
return {
'md-active': this.id === this.MdBottomBar.activeItem
}
},
attrs () {
let attrs = {...this.$attrs}
const propNames = Object.keys(this.$options.propsData)
propNames.forEach(prop => {
if (!ignoredProps.includes(prop)) {
attrs[prop] = this[prop]
}
})
return attrs
}
},
methods: {
Expand Down Expand Up @@ -99,14 +111,7 @@
beforeCreate () {
if (this.$router && this.$options.propsData.to) {
const componentProps = MdRouterLinkProps(this, this.$options.props)
const propNames = Object.keys(this.$options.propsData)
this.$options.props = componentProps
propNames.forEach(prop => {
if (!ignoredProps.includes(prop)) {
this.$attrs[prop] = this.$options.propsData[prop]
}
})
}
},
created () {
Expand Down

0 comments on commit 6860d3a

Please sign in to comment.