Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(MdBottomBarItem): missing props to for router link #1531

Merged
merged 1 commit into from
Feb 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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