大数据展示系统-前端
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.

66 lines
1.3 KiB

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