From 6400921517d4e0b5c5e849ee9a733fa59da3451d Mon Sep 17 00:00:00 2001 From: rigor789 Date: Sun, 8 Mar 2020 13:13:58 +0100 Subject: [PATCH] docs(navigation): initial rewrite of Navigation docs (#330) --- build/plugins/remark.js | 6 +- content/docs/en/routing/navigation.md | 71 + package-lock.json | 3177 ++++++++++++++++--------- package.json | 65 +- 4 files changed, 2152 insertions(+), 1167 deletions(-) create mode 100644 content/docs/en/routing/navigation.md diff --git a/build/plugins/remark.js b/build/plugins/remark.js index a878948b..280c02d3 100644 --- a/build/plugins/remark.js +++ b/build/plugins/remark.js @@ -1,3 +1,6 @@ +const low = require('lowlight'); +low.registerAlias('xml', [ 'vue', 'Vue' ]); + const remark = require('remark'); const lint = require('remark-preset-lint-recommended'); const html = require('remark-html'); @@ -10,6 +13,7 @@ const remarkPing = require('remark-ping'); const shortcodes = require('remark-shortcodes'); const report = require('vfile-reporter'); + function processMarkdown(contents) { return new Promise((resolve, reject) => { remark() @@ -101,4 +105,4 @@ module.exports = function permalinks(options = {}) { done(); } -}; \ No newline at end of file +}; diff --git a/content/docs/en/routing/navigation.md b/content/docs/en/routing/navigation.md new file mode 100644 index 00000000..77de3cb0 --- /dev/null +++ b/content/docs/en/routing/navigation.md @@ -0,0 +1,71 @@ +--- +title: Navigation +contributors: [rigor789] +--- + +Most apps are made of multiple screens the users can interact with. In order to present these different screens to the user, we need a way to navigate between them. NativeScript-Vue provides the following methods to achieve this: +* [`$navigateTo`](#) +* [`$navigateBack`](#) +* [`$showModal`](#) + +In NativeScript-Vue different screens are denoted by the [``](#) tag. + +// todo: emphasize early on that `` tags are mandatory + +## A basic scenario: navigating to a different `` + +Let's say the user is presented with the default `` in our `Home.vue` component and we would like to navigate to a component we defined in `Settings.vue`: +```vue + +``` + +In our Home component, we first need to import the `` component. Most navigation is triggered by the user, in this case we will attach a `@tap` handler to a `