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: