大数据展示系统-前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div>
  3. <div v-for="item in listData" :key="item.ranking" class="list-item">
  4. <div class="book-img">
  5. <img :src="item.cover" :onerror="defaultImg">
  6. </div>
  7. <div class="book-info">
  8. <h4 :class="['book-title', {'title-item': !isOtherBook}]">{{ item.nbName }}</h4>
  9. <p class="book-author">{{ item.nbAuthor }}</p>
  10. <div v-if="!isNewBook" class="book-num">
  11. <svg class="icon" aria-hidden="true">
  12. <use xlink:href="#icon-remen" />
  13. </svg>
  14. <p>{{ item.num }}</p>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'BookListItem',
  23. props: {
  24. listData: {
  25. type: Array,
  26. default: function() {
  27. return []
  28. }
  29. },
  30. isOtherBook: {
  31. type: Boolean,
  32. default: function() {
  33. return false
  34. }
  35. },
  36. isNewBook: {
  37. type: Boolean,
  38. default: function() {
  39. return false
  40. }
  41. }
  42. },
  43. data() {
  44. return {
  45. defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"'
  46. }
  47. },
  48. watch: {
  49. listData: function(newValue, oldValue) {
  50. },
  51. isOtherBook: function(newValue, oldValue) {
  52. },
  53. isNewBook: function(newValue, oldValue) {
  54. }
  55. },
  56. created() {
  57. },
  58. mounted() {
  59. },
  60. methods: {
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. @import "~@/assets/styles/index.scss";
  66. </style>