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

105 lines
1.9 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="hotbook-box">
  3. <div class="most-book">
  4. <div class="most-book-img">
  5. <img :src="bookdata[0].img">
  6. </div>
  7. <div class="most-book-txt book-rack">
  8. <div class="txt">
  9. <h3>书名{{ bookdata[0].title }}</h3>
  10. <p>作者{{ bookdata[0].author }}</p>
  11. <p>出版社</p>
  12. <p>出版日期</p>
  13. </div>
  14. </div>
  15. </div>
  16. <ul class="hotbook-list">
  17. <li v-for="(item,index) in bookdata" :key="index">
  18. <img :src="item.img">
  19. <p>{{ item.title }}</p>
  20. </li>
  21. </ul>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. name: 'BookList',
  27. props: {
  28. bookdata: {
  29. type: Array,
  30. default: function() {
  31. return []
  32. }
  33. }
  34. },
  35. data() {
  36. return {
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. @import "~@/assets/styles/index.scss";
  43. .hotbook-box{
  44. overflow: hidden;
  45. overflow-y: auto;
  46. height: 100%;
  47. }
  48. .book-rack{
  49. margin: 160px 40px 28px 40px;
  50. padding: 38px 40px 40px 400px;
  51. height: 272px;
  52. }
  53. .most-book{
  54. position: relative;
  55. .most-book-img{
  56. position: absolute;
  57. left: 90px;
  58. bottom: 20px;
  59. img{
  60. width: 318px;
  61. height: 382px;
  62. }
  63. }
  64. .txt{
  65. // margin-left: 452px;
  66. color: #333;
  67. h3{
  68. font-size: 40px;
  69. font-weight: normal;
  70. overflow: hidden;
  71. white-space: nowrap;
  72. text-overflow: ellipsis;
  73. }
  74. p{
  75. font-size: 30px;
  76. margin-top: 8px;
  77. overflow: hidden;
  78. white-space: nowrap;
  79. text-overflow: ellipsis;
  80. }
  81. }
  82. }
  83. .hotbook-list{
  84. margin: 0 40px;
  85. display: flex;
  86. flex-wrap: wrap;
  87. // justify-content: space-between;
  88. li{
  89. margin-bottom: 20px;
  90. margin-left: 48px;
  91. img{
  92. width: 300px;
  93. height: 360px;
  94. }
  95. }
  96. & li:nth-child(3n+1){
  97. margin-left: 0;
  98. }
  99. }
  100. </style>