
<template>
  <container :title="chapter.name">
    <file-list :files="files"></file-list>
  </container>
</template>

<script>
// components
import Container from '../../components/container.vue'
import FileList from '../../components/fileList.vue'

// 章节阅读资料
export default {
  name: 'ChapterRead',
  components: { Container, FileList },
  props: {
    // 当前选中的
    chapter: { type: Object, default: () => {} },
    // 课程详情接口返回的数据
    data: { type: Object, default: () => {} }
  },
  computed: {
    files() {
      const reading = this.chapter.reading
      const file = {
        file_name: reading.reading_content,
        file_url: reading.reading_attachment
      }
      return [file]
    }
  }
}
</script>
