Skip to content

Commit 6ba730b

Browse files
committed
update
1 parent 526af4d commit 6ba730b

File tree

4 files changed

+50
-46
lines changed

4 files changed

+50
-46
lines changed

README.md

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# vue-multiple-pages
22

3-
>Vue2.0多页应用
3+
**This project is a modern Vue.js starter
4+
which uses Vue 2, Webpack2, and ElementUI**
45

5-
## Links 依赖链接
6+
## Features
67

7-
1. [Vue](https://github.com/vuejs/vue)
8-
2. [Webpack](https://github.com/webpack/webpack)
9-
3. [Element](https://github.com/ElemeFE/element)
8+
1. [Vue2](https://github.com/vuejs/vue)
9+
2. [Webpack2](https://github.com/webpack/webpack)
10+
3. [ElementUI](https://github.com/ElemeFE/element)
11+
4. [Eslint](https://github.com/eslint/eslint)
1012

11-
## Start 开始
13+
## Start
1214

1315
- Clone or download this repository
1416
- Enter your local directory, and install dependencies:
@@ -17,10 +19,10 @@
1719
npm install
1820
```
1921

20-
## Develop 开发构建
22+
## Dev
2123

2224
``` bash
23-
# serve with hot reload at localhost:8080
25+
# serve with hot reload at localhost:8010
2426
npm run dev
2527

2628
```
@@ -29,7 +31,7 @@ npm run dev
2931

3032
[http://localhost:8010/user/index.html](http://localhost:8010/user/index.html)
3133

32-
## Build 生产构建
34+
## Build
3335

3436
``` bash
3537
# build for production with minification
@@ -39,30 +41,33 @@ node server.js
3941

4042
[http://localhost:2333/user/login.html](http://localhost:2333/user/login.html)
4143

42-
## Folder Structure 文件目录
44+
## Folder Structure
4345

4446
```bash
45-
├── src # 主目录
46-
│ ├── assets # 资源目录
47+
├── src # main
48+
│ ├── assets # source
4749
│ │ ├── css # css
48-
│ │ └── img # 图片目录
49-
│ ├── components # 自定义组件目录
50-
│ └── pages # 页面目录
51-
│ └── user # 业务模块目录
52-
│ ├── index # index 页面
53-
│ │ ├── app.js # 入口js
54-
│ │ ├── app.html # html模板
55-
│ │ └── app.vue # index 页面组件
56-
│ └── login # login 页面
57-
│ ├── app.js # 入口js
58-
│ ├── app.html # html模板
59-
│ └── app.vue # login 页面组件
60-
├── dist # npm run build生成的目录
50+
│ │ └── img # img
51+
│ ├── components # components
52+
│ └── pages # pages
53+
│ └── user # user part
54+
│ ├── index # index.html
55+
│ │ ├── app.js # entry js
56+
│ │ ├── app.html # html template
57+
│ │ └── app.vue # main vue for login
58+
│ └── login # login.html
59+
│ ├── app.js # entry js
60+
│ ├── app.html # html template
61+
│ └── app.vue # main vue for login
62+
├── dist # npm run build result
6163
├── node_modules # dependencies
62-
├── .babelrc # babel文件
63-
├── .eslintrc.js # eslint配置
64-
├── server.js # 用于查看npm run build的server.js,端口2333
65-
├── webpack.config.js # webpack配置目录
64+
├── .babelrc # babel config
65+
├── .eslintrc.js # eslint config
66+
├── server.js # port 2333
67+
├── webpack.config.js # webpack config
6668
├── node_modules # dependencies
6769
└── package.json # package info
6870
```
71+
72+
## License
73+
MIT

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "vue-multiple-pages",
3-
"description": "A Vue.js project",
3+
"description": "A Vue2 starter",
44
"author": "plortinus@gmail.com",
5-
"private": true,
5+
"license": "MIT",
66
"scripts": {
77
"dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot",
88
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"

server.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//var TARGET = 'https://github.com';
2-
var express = require('express');
3-
var app = express();
4-
var http = require('http');
5-
var httpProxy = require('http-proxy');
6-
var proxy = httpProxy.createProxyServer({});
1+
// var TARGET = 'https://github.com';
2+
var express = require('express')
3+
var app = express()
4+
var http = require('http')
5+
var httpProxy = require('http-proxy')
6+
var proxy = httpProxy.createProxyServer({})
77

8-
app.use(express.static('./dist'));
8+
app.use(express.static('./dist'))
99

1010
// app.all('/*', function(req, res, next) {
1111
// console.log(req.url);
@@ -15,8 +15,8 @@ app.use(express.static('./dist'));
1515
// // next();
1616
// });
1717

18-
app.get('/', function(req, res) {
19-
res.send('Hello Vue');
20-
});
18+
app.get('/', function (req, res) {
19+
res.send('Hello Vue')
20+
})
2121

22-
app.listen(2333);
22+
app.listen(2333)

webpack.config.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const config = {
2222
publicPath: '/'
2323
},
2424
resolve: {
25-
// 配置别名,在项目中可缩减引用路径
2625
extensions: ['.js', '.vue'],
2726
alias: {
2827
assets: join(__dirname, '/src/assets'),
@@ -100,10 +99,10 @@ const config = {
10099

101100
glob.sync('./src/pages/**/*.html').forEach(function (name) {
102101
const pathname = name.slice(name.lastIndexOf('src/') + 4, name.length - 5)
103-
// filename 用文件夹名字
102+
// filename used folder's name
104103
const conf = {
105-
filename: pathname.substring(6, pathname.length - 4) + '.html', // 生成的html存放路径,相对于path
106-
template: 'src/' + pathname + '.html' // html模板路径
104+
filename: pathname.substring(6, pathname.length - 4) + '.html',
105+
template: 'src/' + pathname + '.html'
107106
}
108107
const chunk = pathname.substring(6, pathname.length)
109108
if (chunks.indexOf(chunk) > -1) {

0 commit comments

Comments
 (0)