Skip to content

Commit

Permalink
reactor: v2: ExceptionPage move to components/
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Mar 25, 2019
1 parent c5cdf68 commit cfc3bbc
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 90 deletions.
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
<template>
<div class="exception">
<div class="img">
<img :src="config[type].img"/>
</div>
<div class="content">
<h1>{{ config[type].title }}</h1>
<div class="desc">{{ config[type].desc }}</div>
<div class="action">
<a-button type="primary" @click="handleToHome">θΏ”ε›žι¦–ι‘΅</a-button>
</div>
</div>
</div>
</template>

<script>
import types from './type'
export default {
name: 'Exception',
props: {
type: {
type: String,
default: '404'
}
},
data () {
return {
config: types
}
},
methods: {
handleToHome () {
this.$router.push({ name: 'dashboard' })
}
}
}
</script>

<style lang="less" scoped>
.exception {
min-height: 500px;
height: 80%;
align-items: center;
text-align: center;
margin-top: 150px;
.img {
display: inline-block;
padding-right: 52px;
zoom: 1;
img {
height: 360px;
max-width: 430px;
}
}
.content {
display: inline-block;
flex: auto;
h1 {
color: #434e59;
font-size: 72px;
font-weight: 600;
line-height: 72px;
margin-bottom: 24px;
}
.desc {
color: rgba(0, 0, 0, .45);
font-size: 20px;
line-height: 28px;
margin-bottom: 16px;
}
}
}
.mobile {
.exception {
margin-top: 30px;
.img {
padding-right: unset;
img {
height: 40%;
max-width: 80%;
}
}
}
}
<template>
<div class="exception">
<div class="img">
<img :src="config[type].img"/>
</div>
<div class="content">
<h1>{{ config[type].title }}</h1>
<div class="desc">{{ config[type].desc }}</div>
<div class="action">
<a-button type="primary" @click="handleToHome">θΏ”ε›žι¦–ι‘΅</a-button>
</div>
</div>
</div>
</template>

<script>
import types from './type'
export default {
name: 'Exception',
props: {
type: {
type: String,
default: '404'
}
},
data () {
return {
config: types
}
},
methods: {
handleToHome () {
this.$router.push({ name: 'dashboard' })
}
}
}
</script>

<style lang="less" scoped>
.exception {
min-height: 500px;
height: 80%;
align-items: center;
text-align: center;
margin-top: 150px;
.img {
display: inline-block;
padding-right: 52px;
zoom: 1;
img {
height: 360px;
max-width: 430px;
}
}
.content {
display: inline-block;
flex: auto;
h1 {
color: #434e59;
font-size: 72px;
font-weight: 600;
line-height: 72px;
margin-bottom: 24px;
}
.desc {
color: rgba(0, 0, 0, .45);
font-size: 20px;
line-height: 28px;
margin-bottom: 16px;
}
}
}
.mobile {
.exception {
margin-top: 30px;
.img {
padding-right: unset;
img {
height: 40%;
max-width: 80%;
}
}
}
}
</style>
2 changes: 2 additions & 0 deletions src/components/Exception/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import ExceptionPage from './ExceptionPage.vue'
export default ExceptionPage
File renamed without changes.
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import STable from '@/components/Table'
import MultiTab from '@/components/MultiTab'
import Result from '@/components/Result'
import IconSelector from '@/components/IconSelector'
import ExceptionPage from '@/components/Exception'

export {
AvatarList,
Expand All @@ -46,5 +47,6 @@ export {
STable,
MultiTab,
Result,
ExceptionPage,
IconSelector
}
2 changes: 1 addition & 1 deletion src/views/exception/403.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import ExceptionPage from './ExceptionPage'
import { ExceptionPage } from '@/components'
export default {
components: {
Expand Down
2 changes: 1 addition & 1 deletion src/views/exception/404.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import ExceptionPage from './ExceptionPage'
import { ExceptionPage } from '@/components'
export default {
components: {
Expand Down
2 changes: 1 addition & 1 deletion src/views/exception/500.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import ExceptionPage from './ExceptionPage'
import { ExceptionPage } from '@/components'
export default {
components: {
Expand Down

0 comments on commit cfc3bbc

Please sign in to comment.