Skip to content

Commit 91e7b8f

Browse files
committed
Send props not defined on the route component in $attrs.
Fixes vuejs#1695.
1 parent f3b86fd commit 91e7b8f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/view.js

+8
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ export default {
6969

7070
// resolve props
7171
data.props = resolveProps(route, matched.props && matched.props[name])
72+
data.attrs = {}
73+
74+
for (const key in data.props) {
75+
if (!('props' in component) || !(key in component.props)) {
76+
data.attrs[key] = data.props[key]
77+
delete data.props[key]
78+
}
79+
}
7280

7381
return h(component, data, children)
7482
}

0 commit comments

Comments
 (0)