Skip to content

Commit 492f9ad

Browse files
committed
20201203 First Commit
1 parent ce4f83a commit 492f9ad

File tree

116 files changed

+5061
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+5061
-16
lines changed

Diff for: .editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
insert_final_newline = false
14+
trim_trailing_whitespace = false

Diff for: .env.development

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# just a flag
2+
ENV = 'development'
3+
4+
# base api
5+
VUE_APP_BASE_API = '/dev-api'

Diff for: .env.production

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# just a flag
2+
ENV = 'production'
3+
4+
# base api
5+
VUE_APP_BASE_API = '/prod-api'
6+

Diff for: .env.staging

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
NODE_ENV = production
2+
3+
# just a flag
4+
ENV = 'staging'
5+
6+
# base api
7+
VUE_APP_BASE_API = '/stage-api'
8+

Diff for: .eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/*.js
2+
src/assets
3+
public
4+
dist

Diff for: .gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.DS_Store
2+
node_modules/
3+
dist/
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
package-lock.json
8+
tests/**/coverage/
9+
10+
# Editor directories and files
11+
.idea
12+
.vscode
13+
*.suo
14+
*.ntvs*
15+
*.njsproj
16+
*.sln

Diff for: .travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js: 10
3+
script: npm run test
4+
notifications:
5+
email: false

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017-present PanJiaChen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, 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,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: README-zh.md

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# vue-admin-template
2+
3+
> 这是一个极简的 vue admin 管理后台。它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。
4+
5+
[线上地址](http://panjiachen.github.io/vue-admin-template)
6+
7+
[国内访问](https://panjiachen.gitee.io/vue-admin-template)
8+
9+
目前版本为 `v4.0+` 基于 `vue-cli` 进行构建,若你想使用旧版本,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0),它不依赖 `vue-cli`
10+
11+
## Extra
12+
13+
如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用该分支[permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
14+
15+
## 相关项目
16+
17+
- [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
18+
19+
- [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
20+
21+
- [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template)
22+
23+
- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312)
24+
25+
写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目:
26+
27+
- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
28+
- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
29+
- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
30+
- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板,专门针对本项目的文章,算作是一篇文档)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
31+
- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
32+
33+
## Build Setup
34+
35+
```bash
36+
# 克隆项目
37+
git clone https://github.com/PanJiaChen/vue-admin-template.git
38+
39+
# 进入项目目录
40+
cd vue-admin-template
41+
42+
# 安装依赖
43+
npm install
44+
45+
# 建议不要直接使用 cnpm 安装以来,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
46+
npm install --registry=https://registry.npm.taobao.org
47+
48+
# 启动服务
49+
npm run dev
50+
```
51+
52+
浏览器访问 [http://localhost:9528](http://localhost:9528)
53+
54+
## 发布
55+
56+
```bash
57+
# 构建测试环境
58+
npm run build:stage
59+
60+
# 构建生产环境
61+
npm run build:prod
62+
```
63+
64+
## 其它
65+
66+
```bash
67+
# 预览发布环境效果
68+
npm run preview
69+
70+
# 预览发布环境效果 + 静态资源分析
71+
npm run preview -- --report
72+
73+
# 代码格式检查
74+
npm run lint
75+
76+
# 代码格式检查并自动修复
77+
npm run lint -- --fix
78+
```
79+
80+
更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/)
81+
82+
## 购买贴纸
83+
84+
你也可以通过 购买[官方授权的贴纸](https://smallsticker.com/product/vue-element-admin) 的方式来支持 vue-element-admin - 每售出一张贴纸,我们将获得 2 元的捐赠。
85+
86+
## Demo
87+
88+
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
89+
90+
## Browsers support
91+
92+
Modern browsers and Internet Explorer 10+.
93+
94+
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
95+
| --------- | --------- | --------- | --------- |
96+
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
97+
98+
## License
99+
100+
[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
101+
102+
Copyright (c) 2017-present PanJiaChen

Diff for: README.md

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# vue-admin-template
2+
3+
English | [简体中文](./README-zh.md)
4+
5+
> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint
6+
7+
**Live demo:** http://panjiachen.github.io/vue-admin-template
8+
9+
10+
**The current version is `v4.0+` build on `vue-cli`. If you want to use the old version , you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0), it does not rely on `vue-cli`**
11+
12+
## Build Setup
13+
14+
```bash
15+
# clone the project
16+
git clone https://github.com/PanJiaChen/vue-admin-template.git
17+
18+
# enter the project directory
19+
cd vue-admin-template
20+
21+
# install dependency
22+
npm install
23+
24+
# develop
25+
npm run dev
26+
```
27+
28+
This will automatically open http://localhost:9528
29+
30+
## Build
31+
32+
```bash
33+
# build for test environment
34+
npm run build:stage
35+
36+
# build for production environment
37+
npm run build:prod
38+
```
39+
40+
## Advanced
41+
42+
```bash
43+
# preview the release environment effect
44+
npm run preview
45+
46+
# preview the release environment effect + static resource analysis
47+
npm run preview -- --report
48+
49+
# code format check
50+
npm run lint
51+
52+
# code format check and auto fix
53+
npm run lint -- --fix
54+
```
55+
56+
Refer to [Documentation](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) for more information
57+
58+
## Demo
59+
60+
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
61+
62+
## Extra
63+
64+
If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
65+
66+
For `typescript` version, you can use [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour))
67+
68+
## Related Project
69+
70+
- [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
71+
72+
- [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
73+
74+
- [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template)
75+
76+
- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312)
77+
78+
## Browsers support
79+
80+
Modern browsers and Internet Explorer 10+.
81+
82+
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
83+
| --------- | --------- | --------- | --------- |
84+
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
85+
86+
## License
87+
88+
[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
89+
90+
Copyright (c) 2017-present PanJiaChen

Diff for: babel.config.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
presets: [
3+
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
4+
'@vue/cli-plugin-babel/preset'
5+
],
6+
'env': {
7+
'development': {
8+
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
9+
// This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
10+
// https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
11+
'plugins': ['dynamic-import-node']
12+
}
13+
}
14+
}

Diff for: build/index.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const { run } = require('runjs')
2+
const chalk = require('chalk')
3+
const config = require('../vue.config.js')
4+
const rawArgv = process.argv.slice(2)
5+
const args = rawArgv.join(' ')
6+
7+
if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
8+
const report = rawArgv.includes('--report')
9+
10+
run(`vue-cli-service build ${args}`)
11+
12+
const port = 9526
13+
const publicPath = config.publicPath
14+
15+
var connect = require('connect')
16+
var serveStatic = require('serve-static')
17+
const app = connect()
18+
19+
app.use(
20+
publicPath,
21+
serveStatic('./dist', {
22+
index: ['index.html', '/']
23+
})
24+
)
25+
26+
app.listen(port, function () {
27+
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
28+
if (report) {
29+
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
30+
}
31+
32+
})
33+
} else {
34+
run(`vue-cli-service build ${args}`)
35+
}

Diff for: index.html

-16
This file was deleted.

Diff for: jest.config.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
3+
transform: {
4+
'^.+\\.vue$': 'vue-jest',
5+
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
6+
'jest-transform-stub',
7+
'^.+\\.jsx?$': 'babel-jest'
8+
},
9+
moduleNameMapper: {
10+
'^@/(.*)$': '<rootDir>/src/$1'
11+
},
12+
snapshotSerializers: ['jest-serializer-vue'],
13+
testMatch: [
14+
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
15+
],
16+
collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
17+
coverageDirectory: '<rootDir>/tests/unit/coverage',
18+
// 'collectCoverage': true,
19+
'coverageReporters': [
20+
'lcov',
21+
'text-summary'
22+
],
23+
testURL: 'http://localhost/'
24+
}

Diff for: jsconfig.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"paths": {
5+
"@/*": ["src/*"]
6+
}
7+
},
8+
"exclude": ["node_modules", "dist"]
9+
}

0 commit comments

Comments
 (0)