banner.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div id="banner">
  3. <el-row v-if="bannerInfo.info.display">
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="one">
  6. <el-carousel
  7. :height="bannerInfo.info.height"
  8. :trigger="bannerInfo.info.trigger"
  9. :autoplay="bannerInfo.info.autoplay"
  10. :interval="bannerInfo.info.interval"
  11. :indicator-position="bannerInfo.info.indicatorpos"
  12. :arrow="bannerInfo.info.arrow"
  13. :type="bannerInfo.info.type"
  14. :loop="bannerInfo.info.loop"
  15. :direction="bannerInfo.info.direction"
  16. >
  17. <el-carousel-item v-for="(item, index) in bannerInfo.list" :key="index">
  18. <el-image :src="item.url"></el-image>
  19. </el-carousel-item>
  20. </el-carousel>
  21. </el-col>
  22. </el-col>
  23. </el-row>
  24. </div>
  25. </template>
  26. <script>
  27. import { mapState, createNamespacedHelpers } from 'vuex';
  28. export default {
  29. name: 'banner',
  30. props: {
  31. bannerInfo: { type: Object, default: () => {} },
  32. },
  33. components: {},
  34. data: function() {
  35. return {};
  36. },
  37. created() {},
  38. methods: {},
  39. computed: {
  40. ...mapState(['user']),
  41. },
  42. metaInfo() {
  43. return { title: this.$route.meta.title };
  44. },
  45. watch: {
  46. test: {
  47. deep: true,
  48. immediate: true,
  49. handler(val) {},
  50. },
  51. },
  52. };
  53. </script>
  54. <style lang="less" scoped>
  55. .main {
  56. .one {
  57. .el-image {
  58. width: 100%;
  59. height: 400px;
  60. overflow: hidden;
  61. }
  62. }
  63. }
  64. </style>