Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

ExceptionPage.vue 1.3 KiB

2 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div class="exception-page">
  3. <div class="img">
  4. <img :src="config[type].img" />
  5. </div>
  6. <div class="content">
  7. <h1>{{config[type].title}}</h1>
  8. <div class="desc">{{config[type].desc}}</div>
  9. <div class="action">
  10. <a-button type="primary" @click="backHome">返回首页</a-button>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import Config from './typeConfig'
  17. export default {
  18. name: 'ExceptionPage',
  19. props: ['type', 'homeRoute'],
  20. data () {
  21. return {
  22. config: Config
  23. }
  24. },
  25. methods: {
  26. backHome() {
  27. if (this.homeRoute) {
  28. this.$router.push(this.homeRoute)
  29. }
  30. this.$emit('backHome', this.type)
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="less" scoped>
  36. .exception-page{
  37. border-radius: 4px;
  38. display: flex;
  39. justify-content: center;
  40. align-items: center;
  41. background-color: @base-bg-color;
  42. .img{
  43. padding-right: 52px;
  44. zoom: 1;
  45. img{
  46. max-width: 430px;
  47. }
  48. }
  49. .content{
  50. h1{
  51. color: #434e59;
  52. font-size: 72px;
  53. font-weight: 600;
  54. line-height: 72px;
  55. margin-bottom: 24px;
  56. }
  57. .desc{
  58. color: @text-color-second;
  59. font-size: 20px;
  60. line-height: 28px;
  61. margin-bottom: 16px;
  62. }
  63. }
  64. }
  65. </style>