Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa2d3dc

Browse files
committed
start
1 parent b0e4c6d commit fa2d3dc

File tree

6 files changed

+27
-75
lines changed

6 files changed

+27
-75
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# https://editorconfig.org
1+
# https://editorconfig.org 有助于维护跨多个编辑器和IDE从事同一项目的多个开发人员的一致编码风格
22
root = true
33

44
[*]

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ module.exports = {
105105
}],
106106
'no-lone-blocks': 2,
107107
'no-mixed-spaces-and-tabs': 2,
108-
'no-multi-spaces': 2,
108+
'no-multi-spaces': 0, //2修改为0
109109
'no-multi-str': 2,
110110
'no-multiple-empty-lines': [2, {
111111
'max': 1
@@ -132,7 +132,7 @@ module.exports = {
132132
'no-sparse-arrays': 2,
133133
'no-this-before-super': 2,
134134
'no-throw-literal': 2,
135-
'no-trailing-spaces': 2,
135+
'no-trailing-spaces': 0, //2修改为0
136136
'no-undef': 2,
137137
'no-undef-init': 2,
138138
'no-unexpected-multiline': 2,

README.md

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,6 @@
22
<img width="320" src="https://wpimg.wallstcn.com/ecc53a42-d79b-42e2-8852-5126b810a4c8.svg">
33
</p>
44

5-
<p align="center">
6-
<a href="https://github.com/vuejs/vue">
7-
<img src="https://img.shields.io/badge/vue-2.6.10-brightgreen.svg" alt="vue">
8-
</a>
9-
<a href="https://github.com/ElemeFE/element">
10-
<img src="https://img.shields.io/badge/element--ui-2.7.0-brightgreen.svg" alt="element-ui">
11-
</a>
12-
<a href="https://travis-ci.org/PanJiaChen/vue-element-admin" rel="nofollow">
13-
<img src="https://travis-ci.org/PanJiaChen/vue-element-admin.svg?branch=master" alt="Build Status">
14-
</a>
15-
<a href="https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE">
16-
<img src="https://img.shields.io/github/license/mashape/apistatus.svg" alt="license">
17-
</a>
18-
<a href="https://github.com/PanJiaChen/vue-element-admin/releases">
19-
<img src="https://img.shields.io/github/release/PanJiaChen/vue-element-admin.svg" alt="GitHub release">
20-
</a>
21-
<a href="https://gitter.im/vue-element-admin/discuss">
22-
<img src="https://badges.gitter.im/Join%20Chat.svg" alt="gitter">
23-
</a>
24-
<a href="https://panjiachen.gitee.io/vue-element-admin-site/zh/donate">
25-
<img src="https://img.shields.io/badge/%24-donate-ff69b4.svg" alt="donate">
26-
</a>
27-
</p>
285

296
## 简介
307

@@ -81,12 +58,6 @@
8158
<img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png">
8259
</p>
8360

84-
## Sponsors
85-
86-
Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen)
87-
88-
### Akveo
89-
<a href="https://store.akveo.com/products/vue-java-admin-dashboard-spring?utm_campaign=akveo_store-Vue-Vue_demo%2Fgithub&utm_source=vue_admin&utm_medium=referral&utm_content=github_banner"><img width="500px" src="https://raw.githubusercontent.com/PanJiaChen/vue-element-admin-site/master/docs/.vuepress/public/images/vue-java-banner.png" /></a><p>Java 后端整合,可以使用优惠码:SWB0RAZPZR1M,获得20%的价格优化</p>
9061

9162
### Flatlogic
9263

@@ -217,33 +188,4 @@ Detailed changes for each release are documented in the [release notes](https://
217188

218189
## Online Demo
219190

220-
[在线 Demo](https://panjiachen.github.io/vue-element-admin)
221-
222-
## Donate
223-
224-
如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励 :tropical_drink:
225-
![donate](https://panjiachen.github.io/donate/donation.png)
226-
227-
[更多捐赠方式](https://panjiachen.gitee.io/vue-element-admin-site/zh/donate)
228-
229-
[Paypal Me](https://www.paypal.me/panfree23)
230-
231-
[Buy me a coffee](https://www.buymeacoffee.com/Pan)
232-
233-
## 购买贴纸
234-
235-
你也可以通过 购买[官方授权的贴纸](https://smallsticker.com/product/vue-element-admin) 的方式来支持 vue-element-admin - 每售出一张贴纸,本项目将获得 2 元的捐赠。
236-
237-
## Browsers support
238-
239-
Modern browsers and Internet Explorer 10+.
240-
241-
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](https://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" />](https://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" />](https://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" />](https://godban.github.io/browsers-support-badges/)</br>Safari |
242-
| --------- | --------- | --------- | --------- |
243-
| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
244-
245-
## License
246-
247-
[MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
248-
249-
Copyright (c) 2017-present PanJiaChen
191+
[在线 Demo](https://panjiachen.github.io/vue-element-admin)

src/layout/components/AppMain.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<section class="app-main">
33
<transition name="fade-transform" mode="out-in">
44
<keep-alive :include="cachedViews">
5-
<router-view :key="key" />
5+
<router-view :key="key" /> //在 router-view上加上一个唯一的key,来保证路由切换时都会重新渲染触发钩子了
66
</keep-alive>
77
</transition>
88
</section>

src/utils/request.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,26 @@ import { MessageBox, Message } from 'element-ui'
33
import store from '@/store'
44
import { getToken } from '@/utils/auth'
55

6-
// create an axios instance
76
const service = axios.create({
87
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
9-
// withCredentials: true, // send cookies when cross-domain requests
10-
timeout: 5000 // request timeout
8+
// withCredentials: true, // 发送跨域请求时
9+
timeout: 5000
1110
})
1211

13-
// request interceptor
1412
service.interceptors.request.use(
1513
config => {
16-
// do something before request is sent
17-
18-
if (store.getters.token) {
19-
// let each request carry token
20-
// ['X-Token'] is a custom headers key
21-
// please modify it according to the actual situation
14+
if (store.getters.token) { // 让每个请求携带token--['X-Token']为自定义key 请根据实际情况自行修改
2215
config.headers['X-Token'] = getToken()
2316
}
2417
return config
2518
},
2619
error => {
2720
// do something with request error
28-
console.log(error) // for debug
21+
console.log(error)
2922
return Promise.reject(error)
3023
}
3124
)
3225

33-
// response interceptor
3426
service.interceptors.response.use(
3527
/**
3628
* If you want to get http information such as headers or status

学习笔记.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
1. ###### process.env.NODE_ENV
2+
3+
> https://www.jianshu.com/p/c8f9c61c2f20
4+
5+
2. ###### 路由跳转但跳转到同一组件时created和mounted不会触发的问题
6+
7+
> 1. ​ 在父组件用watch监视‘$route’: https://router.vuejs.org/zh/guide/advanced/transitions.html#%E5%9F%BA%E4%BA%8E%E8%B7%AF%E7%94%B1%E7%9A%84%E5%8A%A8%E6%80%81%E8%BF%87%E6%B8%A1
8+
> 2. 简单的在 router-view上加上一个唯一的key: https://juejin.cn/post/6844903476661583880#heading-16
9+
10+
3. a
11+
12+
4. a
13+
14+
5. a
15+
16+
6. a
17+
18+
7.

0 commit comments

Comments
 (0)