index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="home-container">
  3. <div class="wrap" ref="editor">
  4. <div class="top"></div>
  5. <div class="box">一些内容</div>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import { screenSize } from "@/assets/js/utils";
  11. export default {
  12. name: "Home",
  13. components: {},
  14. data() {
  15. return {};
  16. },
  17. computed: {},
  18. created() {},
  19. mounted() {
  20. screenSize(this.$refs.editor);
  21. },
  22. methods: {},
  23. };
  24. </script>
  25. <style lang="less" scoped>
  26. .home-container {
  27. position: absolute;
  28. left: 0;
  29. top: 0;
  30. width: 100%;
  31. height: 100%;
  32. .wrap {
  33. transform-origin: 0px 0px 0px;
  34. background: url(../../assets/img/bj.jpg) no-repeat;
  35. background-size: contain;
  36. background-position: 50% 0;
  37. background-color: rgb(0, 0, 0);
  38. min-width: auto;
  39. width: 1920px;
  40. min-height: auto;
  41. height: 1080px;
  42. overflow: auto;
  43. .top {
  44. position: absolute;
  45. left: 0;
  46. top: 0;
  47. width: 100%;
  48. height: 80px;
  49. background-color: transparent;
  50. background: url(../../assets/img/top_nav.png) no-repeat;
  51. background-position: 65% 0;
  52. border: none;
  53. overflow: hidden;
  54. }
  55. .box {
  56. color: #fff;
  57. line-height: 100vh;
  58. text-align: center;
  59. font-size: 40px;
  60. }
  61. }
  62. }
  63. </style>