Skip to content

Commit 9fc3565

Browse files
committed
feat: initialize
0 parents  commit 9fc3565

File tree

111 files changed

+3952
-0
lines changed

Some content is hidden

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

111 files changed

+3952
-0
lines changed

.browserslistrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not dead

.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

.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'

.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+

.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+

.eslintignore

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

.eslintrc.js

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
extends: [
7+
'plugin:vue/vue3-essential',
8+
'@vue/standard'
9+
],
10+
parserOptions: {
11+
parser: 'babel-eslint'
12+
},
13+
rules: {
14+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
15+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16+
"vue/max-attributes-per-line": [2, {
17+
"singleline": 10,
18+
"multiline": {
19+
"max": 1,
20+
"allowFirstLine": false
21+
}
22+
}],
23+
"vue/singleline-html-element-content-newline": "off",
24+
"vue/multiline-html-element-content-newline":"off",
25+
"vue/name-property-casing": ["error", "PascalCase"],
26+
"vue/no-v-html": "off",
27+
'accessor-pairs': 2,
28+
'arrow-spacing': [2, {
29+
'before': true,
30+
'after': true
31+
}],
32+
'block-spacing': [2, 'always'],
33+
'brace-style': [2, '1tbs', {
34+
'allowSingleLine': true
35+
}],
36+
'camelcase': [0, {
37+
'properties': 'always'
38+
}],
39+
'comma-dangle': [2, 'never'],
40+
'comma-spacing': [2, {
41+
'before': false,
42+
'after': true
43+
}],
44+
'comma-style': [2, 'last'],
45+
'constructor-super': 2,
46+
'curly': [2, 'multi-line'],
47+
'dot-location': [2, 'property'],
48+
'eol-last': 2,
49+
'eqeqeq': ["error", "always", {"null": "ignore"}],
50+
'generator-star-spacing': [2, {
51+
'before': true,
52+
'after': true
53+
}],
54+
'handle-callback-err': [2, '^(err|error)$'],
55+
'indent': [2, 2, {
56+
'SwitchCase': 1
57+
}],
58+
'jsx-quotes': [2, 'prefer-single'],
59+
'key-spacing': [2, {
60+
'beforeColon': false,
61+
'afterColon': true
62+
}],
63+
'keyword-spacing': [2, {
64+
'before': true,
65+
'after': true
66+
}],
67+
'new-cap': [2, {
68+
'newIsCap': true,
69+
'capIsNew': false
70+
}],
71+
'new-parens': 2,
72+
'no-array-constructor': 2,
73+
'no-caller': 2,
74+
'no-console': 'off',
75+
'no-class-assign': 2,
76+
'no-cond-assign': 2,
77+
'no-const-assign': 2,
78+
'no-control-regex': 0,
79+
'no-delete-var': 2,
80+
'no-dupe-args': 2,
81+
'no-dupe-class-members': 2,
82+
'no-dupe-keys': 2,
83+
'no-duplicate-case': 2,
84+
'no-empty-character-class': 2,
85+
'no-empty-pattern': 2,
86+
'no-eval': 2,
87+
'no-ex-assign': 2,
88+
'no-extend-native': 2,
89+
'no-extra-bind': 2,
90+
'no-extra-boolean-cast': 2,
91+
'no-extra-parens': [2, 'functions'],
92+
'no-fallthrough': 2,
93+
'no-floating-decimal': 2,
94+
'no-func-assign': 2,
95+
'no-implied-eval': 2,
96+
'no-inner-declarations': [2, 'functions'],
97+
'no-invalid-regexp': 2,
98+
'no-irregular-whitespace': 2,
99+
'no-iterator': 2,
100+
'no-label-var': 2,
101+
'no-labels': [2, {
102+
'allowLoop': false,
103+
'allowSwitch': false
104+
}],
105+
'no-lone-blocks': 2,
106+
'no-mixed-spaces-and-tabs': 2,
107+
'no-multi-spaces': 2,
108+
'no-multi-str': 2,
109+
'no-multiple-empty-lines': [2, {
110+
'max': 1
111+
}],
112+
'no-native-reassign': 2,
113+
'no-negated-in-lhs': 2,
114+
'no-new-object': 2,
115+
'no-new-require': 2,
116+
'no-new-symbol': 2,
117+
'no-new-wrappers': 2,
118+
'no-obj-calls': 2,
119+
'no-octal': 2,
120+
'no-octal-escape': 2,
121+
'no-path-concat': 2,
122+
'no-proto': 2,
123+
'no-redeclare': 2,
124+
'no-regex-spaces': 2,
125+
'no-return-assign': [2, 'except-parens'],
126+
'no-self-assign': 2,
127+
'no-self-compare': 2,
128+
'no-sequences': 2,
129+
'no-shadow-restricted-names': 2,
130+
'no-spaced-func': 2,
131+
'no-sparse-arrays': 2,
132+
'no-this-before-super': 2,
133+
'no-throw-literal': 2,
134+
'no-trailing-spaces': 2,
135+
'no-undef': 2,
136+
'no-undef-init': 2,
137+
'no-unexpected-multiline': 2,
138+
'no-unmodified-loop-condition': 2,
139+
'no-unneeded-ternary': [2, {
140+
'defaultAssignment': false
141+
}],
142+
'no-unreachable': 2,
143+
'no-unsafe-finally': 2,
144+
'no-unused-vars': [2, {
145+
'vars': 'all',
146+
'args': 'none'
147+
}],
148+
'no-useless-call': 2,
149+
'no-useless-computed-key': 2,
150+
'no-useless-constructor': 2,
151+
'no-useless-escape': 0,
152+
'no-whitespace-before-property': 2,
153+
'no-with': 2,
154+
'one-var': [2, {
155+
'initialized': 'never'
156+
}],
157+
'operator-linebreak': [2, 'after', {
158+
'overrides': {
159+
'?': 'before',
160+
':': 'before'
161+
}
162+
}],
163+
'padded-blocks': [2, 'never'],
164+
'quotes': [2, 'single', {
165+
'avoidEscape': true,
166+
'allowTemplateLiterals': true
167+
}],
168+
'semi': [2, 'never'],
169+
'semi-spacing': [2, {
170+
'before': false,
171+
'after': true
172+
}],
173+
'space-before-blocks': [2, 'always'],
174+
'space-before-function-paren': [2, 'never'],
175+
'space-in-parens': [2, 'never'],
176+
'space-infix-ops': 2,
177+
'space-unary-ops': [2, {
178+
'words': true,
179+
'nonwords': false
180+
}],
181+
'spaced-comment': [2, 'always', {
182+
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
183+
}],
184+
'template-curly-spacing': [2, 'never'],
185+
'use-isnan': 2,
186+
'valid-typeof': 2,
187+
'wrap-iife': [2, 'any'],
188+
'yield-star-spacing': [2, 'both'],
189+
'yoda': [2, 'never'],
190+
'prefer-const': 2,
191+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
192+
'object-curly-spacing': [2, 'always', {
193+
objectsInObjects: false
194+
}],
195+
'array-bracket-spacing': [2, 'never']
196+
},
197+
overrides: [
198+
{
199+
files: [
200+
'**/__tests__/*.{j,t}s?(x)',
201+
'**/tests/unit/**/*.spec.{j,t}s?(x)'
202+
],
203+
env: {
204+
jest: true
205+
}
206+
}
207+
]
208+
}

.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
package-lock.json
13+
yarn.lock
14+
yarn-debug.log*
15+
yarn-error.log*
16+
pnpm-debug.log*
17+
18+
# Editor directories and files
19+
.idea
20+
.vscode
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
tests/**/coverage/

.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

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

0 commit comments

Comments
 (0)