error-page.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div class="exception">
  3. <div class="imgBlock"><div class="imgEle" :style="{backgroundImage: 'url(' + this.imgUrl + ')'}"></div></div>
  4. <div class="content">
  5. <h1>{{title}}</h1>
  6. <div class="desc">{{desc}}</div>
  7. <div class="actions">
  8. <router-link to="/"><el-button type="primary">返回首页</el-button></router-link>
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. props: {
  16. title: String,
  17. desc: String,
  18. 'img-url': String,
  19. },
  20. computed: {
  21. styleObject() {
  22. return {
  23. backgroundImage: `url("${this.imgUrl}")`,
  24. };
  25. },
  26. },
  27. };
  28. </script>
  29. <style lang="less" scoped>
  30. .exception {
  31. display: flex;
  32. align-items: center;
  33. height: 100%;
  34. font-family: "Helvetica Neue For Number", -apple-system, BlinkMacSystemFont,
  35. "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
  36. "Helvetica Neue", Helvetica, Arial, sans-serif;
  37. .imgBlock {
  38. flex: 0 0 50%;
  39. width: 50%;
  40. padding-right: 152px;
  41. .imgEle {
  42. height: 360px;
  43. width: 100%;
  44. max-width: 430px;
  45. float: right;
  46. background-repeat: no-repeat;
  47. background-position: 50% 50%;
  48. background-size: 100% 100%;
  49. }
  50. }
  51. .content {
  52. flex: auto;
  53. h1 {
  54. color: #434e59;
  55. font-size: 72px;
  56. font-weight: 600;
  57. line-height: 72px;
  58. margin-top: 0;
  59. margin-bottom: 24px;
  60. }
  61. .desc {
  62. color: rgba(0, 0, 0, 0.45);
  63. font-size: 20px;
  64. line-height: 28px;
  65. margin-bottom: 16px;
  66. }
  67. }
  68. }
  69. @media screen and (max-width: 1200px) {
  70. .exception .imgBlock {
  71. flex: 0 0 62.5%;
  72. width: 62.5%;
  73. padding-right: 88px;
  74. }
  75. }
  76. @media screen and (max-width: 576px) {
  77. .exception {
  78. display: block;
  79. text-align: center;
  80. }
  81. .exception .imgBlock {
  82. padding-right: 0;
  83. margin: 0 auto 24px;
  84. }
  85. }
  86. @media screen and (max-width: 480px) {
  87. .exception .imgBlock {
  88. margin-bottom: -24px;
  89. overflow: hidden;
  90. }
  91. }
  92. </style>