From bf8eb5fa53ac09257021f179c09da203e541761c Mon Sep 17 00:00:00 2001 From: Sam Turrell Date: Fri, 10 Nov 2017 20:47:42 +0000 Subject: [PATCH] Demo --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c37fec5..66cb129 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,15 @@ Inject Laravel routes into your Vue application via [aaronlord/laroute](https://github.com/aaronlord/laroute). I actually recommend the alternative and more slim-lined version of this package from [AXN-Informatique/laravel-laroute](https://github.com/AXN-Informatique/laravel-laroute). +[DEMO](https://samturrell.github.io/vue-laroute/example) + ## Using this plugin Adding vue-laroute to your application is as simple as any other plugin: ```js +import Vue from 'vue'; + import VueLaroute from 'vue-laroute'; import routes from '../path/to/laroute.js'; @@ -17,6 +21,10 @@ Vue.use(VueLaroute, { routes, accessor: '$routes', // Optional: the global variable for accessing the router }); + +new Vue({ + el: '#app', +}); ``` You can now access your global accessor (`$routes` by default) in any component via `this.$routes`, for example: