Skip to content

Commit 4f098f2

Browse files
committed
feat(modal): allow passing props to default modal page
1 parent e924e01 commit 4f098f2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

components/Navigator.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ export default {
88
type: String,
99
default: '/',
1010
},
11+
defaultRouteProps: {
12+
type: Object,
13+
required: false
14+
},
1115
},
1216
render(h) {
13-
this.slotContent = this.slotContent || h(this.defaultRouteComponent)
17+
this.slotContent = this.slotContent || h(this.defaultRouteComponent, { props: this.defaultRouteProps })
1418
return h(
1519
'frame',
1620
{

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export default function install(Vue, {routes}) {
8282
render: h => h(Navigator, {
8383
props: {
8484
id: options.id || 'navigatorModal',
85-
defaultRoute: to
85+
defaultRoute: to,
86+
defaultRouteProps: options.props
8687
}
8788
})
8889
}, options).catch(err => console.log(`[Navigator] Failed to show modal: ${err}`))

0 commit comments

Comments
 (0)