├── src
├── styles
│ ├── colors.scss
│ └── bootstrap.scss
├── locales
│ ├── en-US
│ │ └── common.js
│ └── zh-TW
│ │ └── common.js
├── router
│ └── index.js
├── views
│ ├── About.vue
│ └── Home.vue
├── client-entry.js
├── index.template.html
├── components
│ ├── LanguagePicker.vue
│ └── Spinner.vue
├── filters
│ └── index.js
├── App.vue
├── app.js
├── server-entry.js
├── store
│ └── index.js
└── services
│ └── i18n.js
├── .gitignore
├── public
└── logo.png
├── .babelrc
├── .editorconfig
├── manifest.json
├── .eslintrc.js
├── README.md
├── package.json
└── server.js
/src/styles/colors.scss:
--------------------------------------------------------------------------------
1 | $color-text: #333;
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist/
4 | npm-debug.log
5 | .idea
6 | *.iml
--------------------------------------------------------------------------------
/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/albertchan/vue-ssr-boilerplate/HEAD/public/logo.png
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["es2015", { "modules": false }],
4 | "stage-2"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/src/locales/en-US/common.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | 'nav': {
3 | 'about': 'About',
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/src/locales/zh-TW/common.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | 'nav': {
3 | 'about': '關於',
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Router from 'vue-router';
3 | import Home from '../views/Home.vue';
4 | import About from '../views/About.vue';
5 |
6 | Vue.use(Router);
7 |
8 | export default new Router({
9 | mode: 'history',
10 | scrollBehavior: () => ({ y: 0 }),
11 | routes: [
12 | { path: '/', component: Home },
13 | { path: '/about', component: About },
14 | ],
15 | });
16 |
--------------------------------------------------------------------------------
/src/views/About.vue:
--------------------------------------------------------------------------------
1 |
2 | About
5 |
22 |
23 | ## Build Setup
24 |
25 | **Requires Node.js 6+**
26 |
27 | ``` bash
28 | # install dependencies
29 | npm install
30 |
31 | # serve in dev mode, with hot reload at localhost:8080
32 | npm run dev
33 |
34 | # build for production
35 | npm run build
36 |
37 | # serve in production mode
38 | npm start
39 | ```
40 |
--------------------------------------------------------------------------------
/src/components/Spinner.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
12 |
13 |
54 |
--------------------------------------------------------------------------------
/src/views/Home.vue:
--------------------------------------------------------------------------------
1 |
2 | This is a stripped down version of the 8 | vue-hackernews-2.0 9 | demo featuring Vue 2.0, vue-router, and vuex, with server-side rendering. 10 |
11 |