├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── config
├── .eslintrc
├── banner.js
├── build.js
├── bundle.js
├── entry.js
└── example.js
├── dist
├── README.md
├── vue-laroute.common.js
├── vue-laroute.esm.js
├── vue-laroute.js
└── vue-laroute.min.js
├── example
├── example.js
└── index.html
├── package-lock.json
├── package.json
└── src
├── example.js
├── index.js
└── laroute.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["es2015"],
3 | "plugins": ["babel-plugin-espower"],
4 | "env": {
5 | "test": {
6 | "plugins": ["istanbul"],
7 | "presets": ["power-assert"]
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | config/*.js
2 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "extends": [
4 | "plugin:vue-libs/recommended"
5 | ],
6 | "rules": {
7 | "object-curly-spacing": ["error", "always"],
8 | "no-multiple-empty-lines": ["error", { "max": 2, "maxBOF": 1 }],
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
29 |
30 |
31 | ### vue & vue-laroute version
32 | 2.0.x, x.y.z
33 |
34 | ### Reproduction Link
35 |
36 |
37 | ### Steps to reproduce
38 |
39 | ### What is Expected?
40 |
41 | ### What is actually happening?
42 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/samturrell/vue-laroute/2fded775457989b2b6ee98a216be9f7073550843/.github/PULL_REQUEST_TEMPLATE.md
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | lib
2 | coverage
3 | dist/*.gz
4 | docs/_book
5 | test/e2e/report
6 | test/e2e/screenshots
7 | node_modules
8 | .DS_Store
9 | *.log
10 | *.swp
11 | *~
12 | /.idea/
13 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .*
2 | *.log
3 | *.swp
4 | *.yml
5 | coverage
6 | docs/_book
7 | config
8 | dist/*.map
9 | lib
10 | test
11 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/samturrell/vue-laroute/2fded775457989b2b6ee98a216be9f7073550843/CHANGELOG.md
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # vue-laroute Contributing Guide
2 |
3 | - [Issue Reporting Guidelines](#issue-reporting-guidelines)
4 | - [Pull Request Guidelines](#pull-request-guidelines)
5 | - [Development Setup](#development-setup)
6 |
7 | ## Issue Reporting Guidelines
8 |
9 | - The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately.
10 |
11 | - For simple beginner questions, you can get quick answers from [The Gitter chat room](https://gitter.im/vuejs/vue).
12 |
13 | - For more complicated questions, you can use [the official forum](http://forum.vuejs.org/) or StackOverflow. Make sure to provide enough information when asking your questions - this makes it easier for others to help you!
14 |
15 | - Try to search for your issue, it may have already been answered or even fixed in the development branch.
16 |
17 | - Check if the issue is reproducible with the latest stable version of Vue. If you are using a pre-release, please indicate the specific version you are using.
18 |
19 | - It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
20 |
21 | - It is recommended that you make a JSFiddle/JSBin/Codepen to demonstrate your issue. You could start with [this template](http://jsfiddle.net/5sH6A/) that already includes the latest version of Vue.
22 |
23 | - For bugs that involves build setups, you can create a reproduction repository with steps in the README.
24 |
25 | - If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
26 |
27 | ## Pull Request Guidelines
28 |
29 | - The `master` branch is basically just a snapshot of the latest stable release. All development should be done in dedicated branches. **Do not submit PRs against the `master` branch.**
30 |
31 | - Checkout a topic branch from the relevant branch, e.g. `master`, and merge back against that branch.
32 |
33 | - Work in the `src` folder and **DO NOT** checkin `dist` in the commits.
34 |
35 | - It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
36 |
37 | - Make sure `npm test` passes. (see [development setup](#development-setup))
38 |
39 | - If adding new feature:
40 | - Add accompanying test case.
41 | - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
42 |
43 | - If fixing a bug:
44 | - Provide detailed description of the bug in the PR. Live demo preferred.
45 | - Add appropriate test coverage if applicable.
46 |
47 | ### Work Step Example
48 | - Fork the repository from [samturrell/vue-laroute](https://github.com/samturrell/vue-laroute) !
49 | - Create your topic branch from `master`: `git branch my-new-topic origin/master`
50 | - Add codes and pass tests !
51 | - Commit your changes: `git commit -am 'Add some topic'`
52 | - Push to the branch: `git push origin my-new-topic`
53 | - Submit a pull request to `master` branch of `samturrell/vue-laroute` repository !
54 |
55 | ## Development Setup
56 |
57 | You will need [Node.js](http://nodejs.org).
58 |
59 | After cloning the repo, run:
60 |
61 | $ npm install
62 |
63 | ### Commonly used NPM scripts
64 |
65 | # watch and serve with hot reload unit test at localhost:8080
66 | $ npm run dev
67 |
68 | # lint source codes
69 | $ npm run lint
70 |
71 | # run unit tests in browser (firefox/safari/chrome)
72 | $ npm run test:unit
73 |
74 | # build all dist files, including npm packages
75 | $ npm run build
76 |
77 | # run the full test suite, include linting
78 | $ npm test
79 |
80 | There are some other scripts available in the `scripts` section of the `package.json` file.
81 |
82 | The default test script will do the following: lint with ESLint -> unit tests with coverage. **Please make sure to have this pass successfully before submitting a PR.** Although the same tests will be run against your PR on the CI server, it is better to have it working locally beforehand.
83 |
84 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Sam Turrell
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-laroute
2 |
3 | [](https://www.npmjs.com/package/vue-laroute)
4 | [](https://vuejs.org/)
5 |
6 | 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).
7 |
8 | [DEMO](https://samturrell.github.io/vue-laroute/example)
9 |
10 | ## Using this plugin
11 |
12 | Adding vue-laroute to your application is as simple as any other plugin:
13 |
14 | ```js
15 | import Vue from 'vue';
16 |
17 | import VueLaroute from 'vue-laroute';
18 | import routes from '../path/to/laroute.js';
19 |
20 | Vue.use(VueLaroute, {
21 | routes,
22 | accessor: '$routes', // Optional: the global variable for accessing the router
23 | });
24 |
25 | new Vue({
26 | el: '#app',
27 | });
28 | ```
29 |
30 | You can now access your global accessor (`$routes` by default) in any component via `this.$routes`, for example:
31 |
32 | ```js
33 |
34 |