Skip to content

Commit

Permalink
Added Vue Devtools docs, removed Templates, closes nativescript-vue#184
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 committed Sep 17, 2018
1 parent 62ccb2c commit e4aa16c
Show file tree
Hide file tree
Showing 8 changed files with 1,478 additions and 1,439 deletions.
8 changes: 4 additions & 4 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ const multimatch = require('multimatch');

// plugins
const collections = require('metalsmith-collections');
const minify = require('metalsmith-html-minifier');
const linkcheck = require('metalsmith-linkcheck');
const dates = require('metalsmith-jekyll-dates');
const sitemap = require('metalsmith-sitemap');
const static = require('metalsmith-static');
const gzip = require('metalsmith-gzip');
const minify = require('metalsmith-html-minifier');
const watch = require('metalsmith-watch');
const gzip = require('metalsmith-gzip');
const when = require('metalsmith-if');
const moment = require('moment');

Expand Down Expand Up @@ -120,11 +120,11 @@ Metalsmith(cwd)
}))
.use(versions({
versions: [
{ name: 'latest (2.0.0 alpha)', url: '//nativescript-vue.org' },
{ name: 'latest (2.0.0)', url: '//nativescript-vue.org' },
{ name: 'v1.3.1', url: '//v1-3-1.nativescript-vue.org' },
],
currentVersion: {
name: 'latest (2.0.0-alpha.2)',
name: 'latest (2.0.0)',
branch: 'master'
} // different for each branch
}))
Expand Down
26 changes: 14 additions & 12 deletions content/docs/en/getting-started/1-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@ contributors: [rigor789, eddyverbruggen, damain, ikoevska, jlooper]

If you don't want the hassle of installing and configuring your system before you can have a taste of NativeScript-Vue, the [NativeScript Playground](/en/docs/getting-started/playground-tutorial) has you covered.

But if [you already have your system ready for native development](/en/docs/getting-started/installation), you can start by using a template:
But if [you already have your system ready for native development](/en/docs/getting-started/installation), you can start by using the [vue-cli-template](https://github.com/nativescript-vue/vue-cli-template):

**Supported features**

- `.vue` single file components
- Vuex—state management (opt-in)
- NativeScript themes
- Application presets

```shell
$ npm install -g @vue/cli @vue/cli-init
$ vue init nativescript-vue/vue-cli-template <project-name>
$ cd <project-name>
$ npm install
$ tns run android --bundle
$ # or
$ tns run ios --bundle
```

Next, run your app using:

```shell
$ tns run <platform> --bundle
```

where platform is `ios` or `android`.

This set of commands performs the following operations on your system:

1. Installs the Vue CLI and its init add-on on your system. This lets you use both the NativeScript CLI and the Vue CLI on your system. Skip this command, if you already have Vue CLI installed.
2. Pulls the selected template (the Vue CLI-compatible NativeScript-Vue template) and creates a project locally. This template relies on `.vue` components and provides routing and Vuex state management out of the box. For more information about the available templates, see [Templates](/en/docs/getting-started/templates).
1. Installs the latest Vue CLI and support for Vue CLI 2.x templates through the `@vue/cli-init` add-on.
2. Creates a project using the [vue-cli-template](https://github.com/nativescript-vue/vue-cli-template).
3. Switches to the directory containing the newly created project.
4. Installs any npm dependencies locally.
5. Builds and runs the project on any connected devices or installed emulators for the selected platform. The `--bundle` option activates webpacking for your project.
5. Builds and runs the project on any connected devices or installed emulators for the selected platform. The `--bundle` option triggers a webpack build, which compiles `.vue` files and watches for changes.
38 changes: 0 additions & 38 deletions content/docs/en/getting-started/4-templates.md

This file was deleted.

58 changes: 58 additions & 0 deletions content/docs/en/getting-started/5-vue-devtools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Using Vue Devtools
contributors: [rigor789]
outdated: false
---

To debug a NativeScript-Vue application with Vue Devtools you need to use the standalone version of Vue Devtools.

To make integration easier we have published [`nativescript-vue-devtools`](https://github.com/nativescript-vue/nativescript-vue-devtools) which takes care of connecting to Vue Devtools.

** 1. Install dependencies **

```shell
$ cd <project-folder>
$ npm install --save @vue/devtools nativescript-toast nativescript-socket.io
```

** 2. Optionally install Vue Devtools globally **

If you'd like to easily access Vue Devtools, it's a good idea to install it globally.

```shell
$ npm install -g @vue/devtools
```

This will allow you to run the `vue-devtools` command regardless of the current directory you are in.

** 3. Install the `nativescript-vue-devtools` plugin into your app **

To connect your application to the devtools, you will have to make a slight modification to your `main.js`.
Import `nativescript-vue-devtools` and tell NativeScript-Vue about it using `Vue.use()`

```js
import Vue from 'nativescript-vue'
import VueDevtools from 'nativescript-vue-devtools'

Vue.use(VueDevtools)
```

** 4. Run Vue Devtools **

```shell
$ # if installed globally
$ vue-devtools
$ # or
$ npx vue-devtools
```

** 5. Rebuild and run your app **

```shell
$ rm -rf platforms
$ tns run android --bundle
$ # or
$ tns run ios --bundle
```

If everything went well, you should see a few components in the component tree of Vue Devtools.
Loading

0 comments on commit e4aa16c

Please sign in to comment.