Skip to content

Commit 4de1e01

Browse files
committed
前端重大升级,可以去体验哦!
1 parent c5172a3 commit 4de1e01

File tree

32 files changed

+674
-99
lines changed

32 files changed

+674
-99
lines changed

images/20181030201718.png

-137 KB
Loading

images/20181030201808.png

-203 KB
Loading

vue-admin-template/.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
ENV = 'production'
33

44
# base api
5-
VUE_APP_BASE_API = 'https://api.xaaef.com'
5+
VUE_APP_BASE_API = 'http://localhost:8090'

vue-admin-template/.env.staging

Lines changed: 0 additions & 8 deletions
This file was deleted.

vue-admin-template/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ module.exports = {
188188
'wrap-iife': [2, 'any'],
189189
'yield-star-spacing': [2, 'both'],
190190
'yoda': [2, 'never'],
191-
'prefer-const': 2,
191+
'prefer-const': 0,
192192
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
193193
'object-curly-spacing': [2, 'always', {
194194
objectsInObjects: false
-61.9 KB
Binary file not shown.
11.6 KB
Loading

vue-admin-template/src/components/Breadcrumb/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
const first = matched[0]
3939
4040
if (!this.isDashboard(first)) {
41-
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
41+
matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched)
4242
}
4343
4444
this.levelList = matched.filter(

vue-admin-template/src/layout/components/AppMain.vue

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<template>
22
<section class="app-main">
33
<transition name="fade-transform" mode="out-in">
4-
<router-view :key="key" />
4+
<keep-alive :include="cachedViews">
5+
<router-view :key="key" />
6+
</keep-alive>
57
</transition>
68
</section>
79
</template>
@@ -10,23 +12,38 @@
1012
export default {
1113
name: 'AppMain',
1214
computed: {
15+
cachedViews() {
16+
return this.$store.state.tagsView.cachedViews
17+
},
1318
key() {
1419
return this.$route.path
1520
}
1621
}
1722
}
1823
</script>
1924

20-
<style scoped>
25+
<style lang="scss" scoped>
2126
.app-main {
22-
/*50 = navbar */
27+
/* 50= navbar 50 */
2328
min-height: calc(100vh - 50px);
2429
width: 100%;
2530
position: relative;
2631
overflow: hidden;
2732
}
33+
2834
.fixed-header+.app-main {
29-
padding-top: 70px;
35+
padding-top: 50px;
36+
}
37+
38+
.hasTagsView {
39+
.app-main {
40+
/* 84 = navbar + tags-view = 50 + 34 */
41+
min-height: calc(100vh - 84px);
42+
}
43+
44+
.fixed-header+.app-main {
45+
padding-top: 84px;
46+
}
3047
}
3148
</style>
3249

vue-admin-template/src/layout/components/Navbar.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ export default {
6565
toggleSideBar() {
6666
this.$store.dispatch('app/toggleSideBar')
6767
},
68-
async logout() {
69-
await this.$store.dispatch('LogOut').then(() => {
70-
location.reload() // 为了重新实例化vue-router对象 避免bug
68+
logout() {
69+
const _this = this
70+
_this.$store.dispatch('LogOut').then(() => {
71+
// 为了重新实例化 vue-router 对象,清空之前的路由列表
72+
window.location.reload()
7173
})
74+
// 跳转到 首页
75+
_this.$router.push({ name: 'Dashboard' })
7276
}
7377
}
7478
}

0 commit comments

Comments
 (0)