top.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div id="top">
  3. <el-row>
  4. <el-col :span="24" class="top" :style="'background: url(' + site.banner + ');'">
  5. <div class="w_1200">
  6. <el-col :span="24" class="topMain">
  7. <el-col :span="2">
  8. <el-image style="width:100px;height:100px" :src="site.logo || ''"></el-image>
  9. </el-col>
  10. <el-col :span="22" class="topTit">
  11. <el-link :underline="false">
  12. {{ site.name }}
  13. </el-link>
  14. </el-col>
  15. </el-col>
  16. </div>
  17. </el-col>
  18. </el-row>
  19. </div>
  20. </template>
  21. <script>
  22. export default {
  23. name: 'top',
  24. props: {},
  25. components: {},
  26. data: () => ({
  27. site: {},
  28. }),
  29. created() {
  30. this.search();
  31. },
  32. computed: {},
  33. methods: {
  34. async search() {
  35. let site = sessionStorage.getItem('site');
  36. if (site) {
  37. site = JSON.parse(site);
  38. this.$set(this, `site`, site);
  39. return;
  40. }
  41. },
  42. },
  43. };
  44. </script>
  45. <style lang="less" scoped>
  46. .w_1200 {
  47. width: 1200px;
  48. margin: 0 auto;
  49. }
  50. .top {
  51. min-height: 300px;
  52. }
  53. .topMain {
  54. padding: 80px 0;
  55. }
  56. .topTit .el-link.el-link--default {
  57. height: 100px;
  58. line-height: 100px;
  59. padding: 0 10px;
  60. font-size: 3em;
  61. font-family: cursive;
  62. color: #850000;
  63. text-shadow: 2px 2px 0 #fff;
  64. }
  65. </style>