Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork245
fix: fallback frame when navigating#948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletionsCHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionpackage.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionpackages/nativescript-vue-template-compiler/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionplatform/nativescript/plugins/navigator-plugin.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletionsplatform/nativescript/util/frame.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionsamples/app/entry.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
require('./multiple-default-frames') |
54 changes: 54 additions & 0 deletionssamples/app/multiple-default-frames.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const Vue = require('nativescript-vue') | ||
Vue.config.silent = false | ||
const wait = ms => new Promise(resolve => setTimeout(resolve, ms)) | ||
const pageComponent = title => ({ | ||
template: ` | ||
<Page> | ||
<Label text="${title}" /> | ||
</Page> | ||
` | ||
}) | ||
let app = new Vue({ | ||
data() { | ||
return { | ||
showSecondFrame: true | ||
} | ||
}, | ||
template: ` | ||
<GridLayout rows="*, auto, *"> | ||
<ContentView row="0"> | ||
<Frame> | ||
${pageComponent('[top frame] Page 1').template} | ||
</Frame> | ||
</ContentView> | ||
<Label row="1" text="--- SEPARATOR ---" textAlignment="center" backgroundColor="#eee" /> | ||
<ContentView row="2" backgroundColor="rgba(255, 0, 0, 0.1)"> | ||
<Frame v-if="showSecondFrame"> | ||
${pageComponent('[bottom frame] Page 2').template} | ||
</Frame> | ||
<Label v-else text="No more frame here..." color="red" verticalAlignment="center" textAlignment="center" /> | ||
</ContentView> | ||
</GridLayout> | ||
`, | ||
mounted() { | ||
this.testNavigations().catch(err => { | ||
console.log(err) | ||
}) | ||
}, | ||
methods: { | ||
async testNavigations() { | ||
await wait(3000) | ||
this.$navigateTo(pageComponent('[bottom frame] Page 3')) | ||
await wait(3000) | ||
this.showSecondFrame = false | ||
await wait(3000) | ||
this.$navigateTo(pageComponent('[top frame] Page 4')) | ||
} | ||
} | ||
}) | ||
app.$start() |
2 changes: 1 addition & 1 deletionsamples/app_resources/Android/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
19 changes: 11 additions & 8 deletionssamples/nativescript.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import { NativeScriptConfig } from'@nativescript/core' | ||
export default { | ||
id: 'org.nativescript.application', | ||
appPath: 'app', | ||
appResourcesPath: 'app_resources', | ||
android: { | ||
markingMode: 'none', | ||
v8Flags: '--expose-gc', | ||
maxLogcatObjectSize: 9999 | ||
}, | ||
cli: { | ||
packageManager: 'yarn' | ||
} | ||
} as NativeScriptConfig |
6 changes: 3 additions & 3 deletionssamples/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
23 changes: 16 additions & 7 deletionssamples/webpack.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
const webpack = require('@nativescript/webpack') | ||
const path = require('path') | ||
module.exports = env => { | ||
webpack.init(env) | ||
// force the vue config, since we don't have nativescript-vue in package.json | ||
webpack.useConfig('vue') | ||
webpack.chainWebpack(config => { | ||
config.set('snapshot', { | ||
managedPaths: [] | ||
}) | ||
config.resolve.alias | ||
// resolve nativescript-vue to built version in parent folder | ||
.set('nativescript-vue', path.resolve(__dirname, '../dist/index.js')) | ||
// resolve nativescript-toasty to the updated version scoped under @triniwiz | ||
.set('nativescript-toasty', '@triniwiz/nativescript-toasty') | ||
config.module | ||
.rule('vue') | ||
.use('vue-loader') | ||
.options({ | ||
compiler: require('nativescript-vue-template-compiler') | ||
}) | ||
}) | ||
return webpack.resolveConfig() | ||
} |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.