1.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div class="bannerItemBox">
  3. <el-carousel height="226px">
  4. <el-carousel-item :key="1">
  5. <div class="bannerItemPositioningBox">
  6. <div class="shadowBox">banner样式1标题标题标题标题标题标题</div>
  7. <img src="@/assets/template/component/banner1.png" />
  8. </div>
  9. </el-carousel-item>
  10. <el-carousel-item :key="2">
  11. <div class="bannerItemPositioningBox">
  12. <div class="shadowBox">banner样式1标题标题标题标题标题标题</div>
  13. <img src="@/assets/template/component/banner2.png" />
  14. </div>
  15. </el-carousel-item>
  16. <el-carousel-item :key="3">
  17. <div class="bannerItemPositioningBox">
  18. <div class="shadowBox">banner样式1标题标题标题标题标题标题</div>
  19. <img src="@/assets/template/component/banner3.png" />
  20. </div>
  21. </el-carousel-item>
  22. </el-carousel>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. props: {
  28. },
  29. data() {
  30. return {
  31. };
  32. },
  33. methods: {
  34. },
  35. mounted() {
  36. },
  37. };
  38. </script>
  39. <style scoped lang="less">
  40. .bannerItemBox {
  41. width: 100%;
  42. .bannerItemPositioningBox {
  43. position: relative;
  44. height: 100%;
  45. img {
  46. width: 100%;
  47. height: 100%;
  48. }
  49. .shadowBox {
  50. position: absolute;
  51. width: 100%;
  52. bottom: 0;
  53. width: 100%;
  54. left: 0;
  55. background: rgba(0,0,0,0.5);
  56. color: #fff;
  57. font-size: 14px;
  58. padding: 10px;
  59. }
  60. }
  61. }
  62. </style>