|
| 1 | +# Onsen UI + Vue + Vue Router PWA Starter Project Template |
| 2 | + |
| 3 | +## Information |
| 4 | +Please read carefully before use this project starter template |
| 5 | + |
| 6 | +1. This project is based on [onsenui-vue-pwa webpack template](https://github.com/OnsenUI/vue-pwa-webpack) |
| 7 | +2. Since I dont need PWA at the moment, so I remove all the script related to PWA in `index.html`. If you want to use PWA, just rename `index-serviceworker.html` to `index.html` |
| 8 | +3. Since I need to access the page via URL in the browser, so instead of using Onsen ui `<v-ons-navigator>` system, I use [vue-router](https://router.vuejs.org/en/) to meet my requirement. |
| 9 | +4. I separate `html` and `scss` in `*.vue` for my convenience, following [Ionic2 project structure](https://www.joshmorony.com/ionic-2-first-look-series-your-first-ionic-2-app-explained/). However if you prefer the vue way, you can switch to [vue project structure](https://github.com/vuejs-templates/webpack/tree/master/template/src). |
| 10 | +5. Use `eslint-airbnb`, thus every line of code should follow [airbnb javascript style guide](http://airbnb.io/javascript/) |
| 11 | +6. Additional rules was added to eslintrc.js as follows : |
| 12 | + - `'no-console': 0`, // allow console.log |
| 13 | + - `'no-param-reassign': 0` // disable warning when assignment to property of function parameter |
| 14 | + |
| 15 | +------------------------------- |
| 16 | + |
| 17 | +## Dependencies |
| 18 | +- onsenui |
| 19 | +- vue |
| 20 | +- vue-onsenui |
| 21 | +- vue-router |
| 22 | +- vuex |
| 23 | + |
| 24 | +------------------------------- |
| 25 | + |
| 26 | +## Build Setup |
| 27 | + |
| 28 | +``` bash |
| 29 | +# install dependencies |
| 30 | +npm install |
| 31 | + |
| 32 | +# serve with hot reload at localhost:8080 |
| 33 | +npm run dev |
| 34 | + |
| 35 | +# build for production with minification |
| 36 | +npm run build |
| 37 | + |
| 38 | +# build for production and view the bundle analyzer report |
| 39 | +npm run build --report |
| 40 | + |
| 41 | +# run unit tests |
| 42 | +npm run unit |
| 43 | + |
| 44 | +# run e2e tests |
| 45 | +npm run e2e |
| 46 | + |
| 47 | +# run all tests |
| 48 | +npm test |
| 49 | +``` |
| 50 | + |
| 51 | +For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). |
| 52 | + |
| 53 | +------------------------------- |
| 54 | + |
| 55 | +## Reference : |
| 56 | +- Separate HTML and SCSS file. [link](https://github.com/vuejs/vueify/issues/35) |
| 57 | +- Enable scss working in vue [link](https://github.com/vuejs/vue-loader/issues/363) |
| 58 | +- Vue routing using hash setup. [link](http://router.vuejs.org/en/essentials/getting-started.html) |
| 59 | +- Getting started with vuex. [link](http://vuex.vuejs.org/en/getting-started.html) |
| 60 | +- Delete service worker. [link](https://stackoverflow.com/a/34791693/1843755) |
| 61 | + |
| 62 | +------------------------------- |
| 63 | +## Screenshots : |
| 64 | + |
| 65 | +### Android |
| 66 | + |
| 67 | +Home Page |
| 68 | +<br/> |
| 69 | +<kbd> |
| 70 | + <img src="screenshots/android.png" width="250px" /> |
| 71 | +</kbd> |
| 72 | +<br/> |
| 73 | +Profile Page |
| 74 | +<br/> |
| 75 | +<kbd> |
| 76 | + <img src="screenshots/android-profile.png" width="250px" /> |
| 77 | +</kbd> |
| 78 | + |
| 79 | +### iPhone |
| 80 | +Home Page |
| 81 | +<br/> |
| 82 | +<kbd> |
| 83 | + <img src="screenshots/iphone.png" width="250px" /> |
| 84 | +</kbd> |
| 85 | +<br/> |
| 86 | +Profile Page |
| 87 | +<br/> |
| 88 | +<kbd> |
| 89 | + <img src="screenshots/iphone-profile.png" width="250px" /> |
| 90 | +</kbd> |
| 91 | + |
0 commit comments