Skip to content

Commit db6df39

Browse files
msaelicesrigor789
authored andcommitted
fix: action bar rendering - issue nativescript-vue#276 (nativescript-vue#278)
* Fix the app-with-pages.js sample by adding a Frame root element and add two action bars in order to reproduce the issue nativescript-vue#276. * Fix page composition when does navigation issue (nativescript-vue#276), which wraps an already Page component in another Page component, losing its action bar.
1 parent 8f2d1a7 commit db6df39

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

platform/nativescript/util/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function isUnknownElement(el) {
3131
}
3232

3333
export function isPage(el) {
34-
return el && el.tagName === 'page'
34+
return el && el.tagName === 'nativepage'
3535
}
3636

3737
/** @deprecated */

samples/app/app-with-pages.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ const Vue = require('./nativescript-vue')
22

33
const App = {
44
template: `
5-
<StackLayout>
6-
<Button text="Open page" @tap="openPage" />
7-
</StackLayout>
5+
<Frame>
6+
<Page>
7+
<ActionBar class="action-bar" title="Home Page">
8+
<ActionItem text="Action"></ActionItem>
9+
</ActionBar>
10+
<StackLayout>
11+
<Button text="Open page" @tap="openPage" />
12+
</StackLayout>
13+
</Page>
14+
</Frame>
815
`,
916

1017
methods: {
@@ -16,11 +23,16 @@ const App = {
1623

1724
const DetailsPage = {
1825
template: `
26+
<Page>
27+
<ActionBar class="action-bar" title="Details Page">
28+
<ActionItem text="Action"></ActionItem>
29+
</ActionBar>
1930
<StackLayout>
2031
<Label :text="'Details ' + Math.random()" />
2132
<Button text="another" @tap="openDetails" />
2233
<Button text="back" @tap="goBack" />
2334
</StackLayout>
35+
</Page>
2436
`,
2537

2638
methods: {

0 commit comments

Comments
 (0)