From 19382f1205cc543dd73b7935c811b18e66a7ca2c Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Wed, 20 May 2020 12:58:15 +0300 Subject: [PATCH 1/2] docs: add installation instructions using Vue CLI --- docs/installation.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/installation.md b/docs/installation.md index b64ecace3..7073c8973 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -32,6 +32,14 @@ Vue.use(VueRouter) You don't need to do this when using global script tags. +## Vue CLI + +If you created a project using [Vue CLI](https://cli.vuejs.org/) you can add Vue Router as a [plugin](https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-router). This will import the router, generate two [named routes](https://router.vuejs.org/guide/essentials/named-routes.html), and overwrite `App.vue` to include two router links. + +```sh +vue add router +``` + ## Dev Build You will have to clone directly from GitHub and build `vue-router` yourself if From 500c4a889d55141039333c29489c445284d4ca91 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 20 May 2020 12:31:22 +0200 Subject: [PATCH 2/2] Update docs/installation.md --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 7073c8973..59823e5bf 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -34,7 +34,7 @@ You don't need to do this when using global script tags. ## Vue CLI -If you created a project using [Vue CLI](https://cli.vuejs.org/) you can add Vue Router as a [plugin](https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-router). This will import the router, generate two [named routes](https://router.vuejs.org/guide/essentials/named-routes.html), and overwrite `App.vue` to include two router links. +If you have a project using [Vue CLI](https://cli.vuejs.org/) you can add Vue Router as a plugin. You can let the CLI generate the code above for you as well as two sample routes. **It will also overwrite your `App.vue`** so make sure to backup up the file before running the following command inside your project: ```sh vue add router