Skip to content

Commit

Permalink
Merge branch 'issue-2877' (PR #3001)
Browse files Browse the repository at this point in the history
Fixes #2877.
  • Loading branch information
emccorson committed Jul 25, 2022
2 parents 1683d08 + ead935e commit 2ae2979
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vue3-onsenui-examples/src/components/Navigator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
log,
push() {
this.$emit('push', markRaw({
...page2,
extends: page2,
onsNavigatorProps: {
myProp: 'This is a navigator prop'
}
Expand Down
16 changes: 14 additions & 2 deletions vue3-onsenui/src/components/VOnsNavigator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<ons-navigator @postpop.self="_checkUserInteraction" :options.prop="options">
<slot>
<component
v-for="page in internalPageStack"
v-for="(page, index) in extendsFix"
:is="page"
:key="page.key || page.name"
:key="index"
v-bind="{ ...unrecognizedListeners, ...page.onsNavigatorProps }"
></component>
</slot>
Expand Down Expand Up @@ -36,6 +36,18 @@
};
},
computed: {
extendsFix() {
// workaround for Vue bug where extends doesn't work with runtime template compilation
// https://github.com/vuejs/core/issues/6249
return this.internalPageStack.map(page =>
page.extends ?
{...page, template: page.extends.template} :
page
);
}
},
methods: {
isReady() {
if (this.hasOwnProperty('_ready') && this._ready instanceof Promise) {
Expand Down

0 comments on commit 2ae2979

Please sign in to comment.