4 changed files with 188 additions and 7 deletions
-
65src/views/data1.json
-
21src/views/hotBook.vue
-
95src/views/module/bookList.vue
-
14src/views/newBook.vue
@ -0,0 +1,95 @@ |
|||
<template> |
|||
<div> |
|||
<div class="most-book"> |
|||
<div class="most-book-img"> |
|||
<img :src="bookdata[0].img"> |
|||
|
|||
</div> |
|||
<div class="most-book-txt book-rack"> |
|||
<div class="txt"> |
|||
<h3>书名:{{ bookdata[0].title }}</h3> |
|||
<p>作者:{{ bookdata[0].author }}</p> |
|||
<p>出版社:</p> |
|||
<p>出版日期:</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<ul class="hotbook-list"> |
|||
<li v-for="item in bookdata" :key="item"> |
|||
<img :src="item.img"> |
|||
<p>{{ item.title }}</p> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
props: { |
|||
bookdata: { |
|||
type: Array, |
|||
default: function() { |
|||
return [] |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "~@/assets/styles/index.scss"; |
|||
.book-rack{ |
|||
margin: 160px 40px 28px 40px; |
|||
padding: 38px 40px 40px 400px; |
|||
height: 272px; |
|||
} |
|||
.most-book{ |
|||
position: relative; |
|||
.most-book-img{ |
|||
position: absolute; |
|||
left: 90px; |
|||
bottom: 20px; |
|||
img{ |
|||
width: 318px; |
|||
height: 382px; |
|||
} |
|||
} |
|||
.txt{ |
|||
// margin-left: 452px; |
|||
color: #333; |
|||
h3{ |
|||
font-size: 40px; |
|||
font-weight: normal; |
|||
overflow: hidden; |
|||
white-space: nowrap; |
|||
text-overflow: ellipsis; |
|||
} |
|||
p{ |
|||
font-size: 30px; |
|||
margin-top: 8px; |
|||
overflow: hidden; |
|||
white-space: nowrap; |
|||
text-overflow: ellipsis; |
|||
} |
|||
} |
|||
} |
|||
.hotbook-list{ |
|||
margin: 0 40px; |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
justify-content: space-between; |
|||
li{ |
|||
margin-bottom: 20px; |
|||
img{ |
|||
width: 300px; |
|||
height: 360px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue