Skip to content

Commit 6860d3a

Browse files
VdustRmarcosmoura
authored andcommitted
fix(MdBottomBarItem): missing props to for router link (#1531)
fix #1412
1 parent 09030c6 commit 6860d3a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/components/MdBottomBar/MdBottomBarItem.vue

+13-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:id="id"
66
:disabled="mdDisabled"
77
:md-ripple="MdBottomBar.type === 'fixed'"
8-
v-bind="$attrs"
8+
v-bind="attrs"
99
v-on="$listeners"
1010
@click="setActiveItem">
1111
<slot v-if="$slots.default"></slot>
@@ -58,6 +58,18 @@
5858
return {
5959
'md-active': this.id === this.MdBottomBar.activeItem
6060
}
61+
},
62+
attrs () {
63+
let attrs = {...this.$attrs}
64+
65+
const propNames = Object.keys(this.$options.propsData)
66+
propNames.forEach(prop => {
67+
if (!ignoredProps.includes(prop)) {
68+
attrs[prop] = this[prop]
69+
}
70+
})
71+
72+
return attrs
6173
}
6274
},
6375
methods: {
@@ -99,14 +111,7 @@
99111
beforeCreate () {
100112
if (this.$router && this.$options.propsData.to) {
101113
const componentProps = MdRouterLinkProps(this, this.$options.props)
102-
const propNames = Object.keys(this.$options.propsData)
103-
104114
this.$options.props = componentProps
105-
propNames.forEach(prop => {
106-
if (!ignoredProps.includes(prop)) {
107-
this.$attrs[prop] = this.$options.propsData[prop]
108-
}
109-
})
110115
}
111116
},
112117
created () {

0 commit comments

Comments
 (0)