Banner.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div class="banner">
  3. <div class="mm"></div>
  4. <div class="banner-img">
  5. <img src="../assets/img/bgtop.jpg" />
  6. </div>
  7. <div class="banner-title">
  8. <p>{{title}}</p>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: "Banner",
  15. props: {
  16. title: {
  17. type: String,
  18. default: ""
  19. },
  20. img: {
  21. type: String,
  22. default: "../assets/img/bgtop.jpg"
  23. }
  24. }
  25. };
  26. </script>
  27. <style lang="scss" scoped>
  28. .banner {
  29. width: 100%;
  30. height: 300px;
  31. display: flex;
  32. position: relative;
  33. overflow: hidden;
  34. background-color: #fff;
  35. .mm {
  36. position: absolute;
  37. width: 100%;
  38. height: 100%;
  39. padding: 10px;
  40. margin: -10px;
  41. filter: blur(10px);
  42. background-image: url(../assets/img/bgtop.jpg);
  43. background-position: center;
  44. background-size: 100%;
  45. }
  46. img {
  47. position: absolute;
  48. //width: 1240px;
  49. height: 100%;
  50. left: 50%;
  51. transform: translate(-50%, 0);
  52. }
  53. &-title {
  54. position: absolute;
  55. color: #fff;
  56. font-size: 45px;
  57. font-weight: 400;
  58. line-height: 300px;
  59. text-align: center;
  60. width: 100%;
  61. }
  62. }
  63. </style>