Comments (13)
Would be cool if NS core exposed some sort of routing abstraction for external frameworks to take advantage of.
from nativescript-vue.
The previous is now implemented, the code needs some cleaning up and refactoring, but for the most part it works on both android and iOS.
On iOS however, there is a bug: if you go back, and try to go to the same route again, nothing happens.
I am pretty sure this is because the back button is navigating back natively, and the routers state is still on the previous route.
from nativescript-vue.
This should be fully functional in 0.3.0
along with custom transitions #68
from nativescript-vue.
VueRouter works out of the box, without any changes! However that's only for "navigating" on a single page. To add support for multiple pages (different activities) it requires some extra work.
from nativescript-vue.
When you say 'multiple pages' what do you mean? I got the router using @tap="$router.push({ name:'recipe',params: {id: recipe.id} })"
- following your router example. Works ok!
from nativescript-vue.
Related to #18 since it would use that internally
from nativescript-vue.
What I mean by pages is that it should allow for navigating to "brand new" instances of a Page, instead of removing all child elements of a single page, and repopulating it with the contents of the new page.
Similar to what ns-angular does https://docs.nativescript.org/angular/core-concepts/angular-navigation.html#pages
router-outlet
which is the current behavior with VueRouter inside nativescript-vue
and page-router-outlet
which is the proposed feature!
from nativescript-vue.
How do we handle the special needs of mobile routing, like handling the back button? When I use a back button on my android emulator to 'go back' - my app crashes on the emulator. Wondering if we have to use a strategy like we do in Angular, using RouterExtensions? - an enhanced mobile-friendly router?
from nativescript-vue.
Update: Quite a bit of progress has been made today, mostly rewriting the older (hacky) implementation with a better solution.
Right now the <modal-page>
component is a functional (stateless) component that registers the router hooks, and handles the back button event.
I am thinking of making this component do much less and extract the logic to the router-plugin.js.
The idea is that if the modal-page component is added to the root component, it simply toggles an option on the root instance, which makes the router use pages. This would serve as syntactic sugar, when you look at the component and see a <router-page>
it tells what is going on...
This would be completely optional, and the option could be toggled manually, something like:
new Vue({
pageRouting: true
}).$start()
from nativescript-vue.
@rigor789 Do you found any solutions for iOS back button bug? It's make me sad, because refactoring and testing app now is very difficult. Would be nice to disable this native option.
from nativescript-vue.
@koddr I haven't had time to look into it, but it is high up on my todo list!
from nativescript-vue.
@rigor789 Nice to listen 👍 keep watching and support project anyway.
from nativescript-vue.
@koddr I pushed some changes to the page routing, can you give it a shot? I tested it on iOS and Android and both seem to work as expected!
from nativescript-vue.
Related Issues (20)
- Add component for template android and ios
- Vue 3: Can't use ios.position and android.position in ActionItem HOT 2
- Axios not supported in Nativescript-Vue apps anymore HOT 2
- v3 version a question HOT 2
- ListView event itemTap differences with the documentation HOT 3
- vite support HOT 1
- Vue DevTools on v3 HOT 4
- How do you programmatically trigger a tap event on a button ? HOT 4
- TabView on Vue3 HOT 2
- docs: A re-write of the NativeScript-Vue documentation site. HOT 2
- navigation in Vue beta 9 or 10 is broken in production mode HOT 4
- vueDevtools not working HOT 2
- Command failed: ruby -e "require 'xcodeproj' HOT 1
- error: Build input file cannot be found: metadata-x86_64.bin HOT 4
- Vue 3: android.startActivity & android.foregroundActivity are undefined HOT 4
- Support for Volar (AKA Vue Language Tools) in VS Code, vue-tsc, etc HOT 3
- Vue Devtools stop working HOT 2
- iOS tap issue when Frame actionBarVisibility is "never"
- Cant run from xcode HOT 11
- Suggestions for NativeScript Vue 3 Docs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-vue.