<template>
  <swiper class="AiNoticeBar" :autoplay="autoplay" vertical circular :interval="2000">
    <swiper-item v-for="(item, index) in ops" :key="index" :display-multiple-items="rows" class="noticeItem">
      <slot :label="item"/>
    </swiper-item>
  </swiper>
</template>

<script>

export default {
  name: 'AiNoticeBar',
  props: {
    list: {default: () => []},
    rows: {default: 1},
    nodeKey: {default: ""},
    autoplay: {default: true}
  },
  computed: {
    ops() {
      let {nodeKey} = this
      return this.list.map(e => e[nodeKey])
    }
  }
}
</script>

<style lang="scss" scoped>
.AiNoticeBar {
  height: 100%;

  .noticeItem {
    height: initial !important;
  }
}
</style>
