From 02ae13a80e1da569d07b2a84dfc8ac69f33c7927 Mon Sep 17 00:00:00 2001 From: Bogdan Luca Date: Fri, 25 Aug 2017 14:24:21 +0300 Subject: [PATCH] Send props not defined on the route component in $attrs. Fixes #1695. --- src/components/view.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/view.js b/src/components/view.js index 3a30adb103..fe134aaab4 100644 --- a/src/components/view.js +++ b/src/components/view.js @@ -69,6 +69,14 @@ export default { // resolve props data.props = resolveProps(route, matched.props && matched.props[name]) + data.attrs = {} + + for (const key in data.props) { + if (!('props' in component) || !(key in component.props)) { + data.attrs[key] = data.props[key] + delete data.props[key] + } + } return h(component, data, children) }