<template>
  <div>
    <DbLearnCount :data="data"></DbLearnCount>
  </div>
</template>

<script>
import DbLearnCount from '@/components/DbLearnCount/index'
import { reqMycourseCount } from '@/api/mycourse/index'
export default {
  components: { DbLearnCount },
  props: {
    courseInfo: {
      type: Object,
      default: () => ({})
    }
  },
  data () {
    return {
      data: {}
    }
  },
  mounted () {
    this.initData()
  },
  methods: {
    initData () {
      const { person } = this.$store.state.user
      reqMycourseCount({ personId: person.id, projectId: this.$route.query.courseId }).then(res => {
        this.data = res.data
      })
    }
  }
}
</script>

<style></style>
