<template>
  <ul class="lecture-list">
    <li v-for="item in data" :key="item.id" @click="onClick(item)">
      <img :src="item.ppt_url" />
    </li>
  </ul>
</template>

<script>
export default {
  props: {
    data: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      activeIndex: 0
    }
  },
  methods: {
    // 点击PPT
    onClick(data) {
      this.activeIndex = data.id
      this.$emit('clickPPT', data)
    }
  }
}
</script>

<style lang="scss" scoped>
.lecture-list {
  padding: 0 16px;
  li {
    padding: 8px 16px;
    cursor: pointer;
    &.is-active {
      background: #888;
    }
    img {
      width: 100%;
    }
  }
}
</style>
