Skip to content

Commit 4ea7730

Browse files
committed
allow router-views to take named slots
1 parent 23991ef commit 4ea7730

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/view.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ export default {
99
default: 'default'
1010
}
1111
},
12-
render (h, { props, children, parent, data }) {
12+
render (_, { props, children, parent, data }) {
1313
data.routerView = true
1414

15+
// directly use parent context's createElement() function
16+
// so that components rendered by router-view can resolve named slots
17+
const h = parent.$createElement
1518
const name = props.name
1619
const route = parent.$route
1720
const cache = parent._routerViewCache || (parent._routerViewCache = {})

0 commit comments

Comments
 (0)