CourseCard.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <el-card class="course-card" @click.native="checkCourseDetail" shadow="hover" :body-style="bodyStyle">
  3. <img :src="picture" class="course-card__picture"/>
  4. <div class="course-card__header">
  5. <h4 class="course-card__title">{{title}}</h4>
  6. <p class="course-card__origin">{{origin}}</p>
  7. </div>
  8. <div class="course-card__description">{{description}}</div>
  9. </el-card>
  10. </template>
  11. <script>
  12. export default {
  13. name: "CourseCard",
  14. props: {
  15. title: {
  16. type: String,
  17. require: true,
  18. default: "课程xxxxxxx"
  19. },
  20. origin: {
  21. type: String,
  22. require: true,
  23. default:"课程提供者xxx"
  24. },
  25. picture: {
  26. type: String,
  27. require: true,
  28. default: "/image/seec_logo.png"
  29. },
  30. url: {
  31. type: String,
  32. require: true,
  33. default: "/"
  34. },
  35. description: {
  36. type: String,
  37. default: ""
  38. }
  39. },
  40. data(){
  41. return{
  42. bodyStyle: {padding : '0'}
  43. }
  44. },
  45. methods: {
  46. checkCourseDetail(){
  47. window.location.href = this.url;
  48. }
  49. }
  50. };
  51. </script>
  52. <style lang="scss" scoped>
  53. @import '~/assets/css/course-card.scss';
  54. </style>