xuhuajiao
2 years ago
7 changed files with 309 additions and 127 deletions
-
2src/App.vue
-
45src/assets/styles/index.scss
-
18src/router/index.js
-
32src/views/bookRackList.vue
-
55src/views/data.json
-
76src/views/index.vue
-
66src/views/module/bookListItem.vue
@ -0,0 +1,32 @@ |
|||||
|
<template> |
||||
|
<div id="bookshelf"> |
||||
|
<!-- <div class="top-bg" /> --> |
||||
|
<div class="bookshelf-header"> |
||||
|
<h2>本架图书</h2> |
||||
|
<span>01架</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'CurrentRackBook', |
||||
|
components: { |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
}, |
||||
|
mounted() { |
||||
|
}, |
||||
|
methods: { |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
@import "~@/assets/styles/index.scss"; |
||||
|
|
||||
|
</style> |
@ -0,0 +1,55 @@ |
|||||
|
{ |
||||
|
"bookList":[ |
||||
|
{ |
||||
|
"img":"https://qiniu.aiyxlib.com/bg.png", |
||||
|
"title": "大个子狗与小个子猫", |
||||
|
"author": "高小定1", |
||||
|
"ranking": 1, |
||||
|
"num": 2000 |
||||
|
}, |
||||
|
{ |
||||
|
"img":"https://qiniu.aiyxlib.com/bg.png", |
||||
|
"title": "大个子狗与小个子猫", |
||||
|
"author": "高小定2", |
||||
|
"ranking": 2, |
||||
|
"num": 1200 |
||||
|
}, |
||||
|
{ |
||||
|
"img":"https://qiniu.aiyxlib.com/bg.png", |
||||
|
"title": "大个子狗与小个子猫", |
||||
|
"author": "高小定3", |
||||
|
"ranking": 3, |
||||
|
"num": 1100 |
||||
|
} |
||||
|
], |
||||
|
"newList":[ |
||||
|
{ |
||||
|
"img":"https://qiniu.aiyxlib.com/bg.png", |
||||
|
"title": "大个子狗与小个子猫", |
||||
|
"author": "高小定1", |
||||
|
"ranking": 1, |
||||
|
"num": 2000 |
||||
|
}, |
||||
|
{ |
||||
|
"img":"https://qiniu.aiyxlib.com/bg.png", |
||||
|
"title": "大个子狗与小个子猫", |
||||
|
"author": "高小定2", |
||||
|
"ranking": 2, |
||||
|
"num": 1200 |
||||
|
}, |
||||
|
{ |
||||
|
"img":"https://qiniu.aiyxlib.com/bg.png", |
||||
|
"title": "大个子狗与小个子猫", |
||||
|
"author": "高小定3", |
||||
|
"ranking": 3, |
||||
|
"num": 1100 |
||||
|
}, |
||||
|
{ |
||||
|
"img":"https://qiniu.aiyxlib.com/bg.png", |
||||
|
"title": "大个子狗与小个子猫", |
||||
|
"author": "高小定4", |
||||
|
"ranking": 4, |
||||
|
"num": 1100 |
||||
|
} |
||||
|
] |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<div v-for="item in listData" :key="item.ranking" class="list-item"> |
||||
|
<img :src="item.img"> |
||||
|
<div class="book-info"> |
||||
|
<h4 :class="['book-title', {'title-item': !isOtherBook}]">{{ item.title }}</h4> |
||||
|
<p class="book-author">{{ item.author }}</p> |
||||
|
<div v-if="!isNewBook" class="book-num"> |
||||
|
<svg class="icon" aria-hidden="true"> |
||||
|
<use xlink:href="#icon-remen" /> |
||||
|
</svg> |
||||
|
<p>{{ item.num }}</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'BookListItem', |
||||
|
props: { |
||||
|
listData: { |
||||
|
type: Array, |
||||
|
default: function() { |
||||
|
return [] |
||||
|
} |
||||
|
}, |
||||
|
isOtherBook: { |
||||
|
type: Boolean, |
||||
|
default: function() { |
||||
|
return false |
||||
|
} |
||||
|
}, |
||||
|
isNewBook: { |
||||
|
type: Boolean, |
||||
|
default: function() { |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
listData: function(newValue, oldValue) { |
||||
|
}, |
||||
|
isOtherBook: function(newValue, oldValue) { |
||||
|
}, |
||||
|
isNewBook: function(newValue, oldValue) { |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
console.log(this.listData) |
||||
|
}, |
||||
|
mounted() { |
||||
|
}, |
||||
|
methods: { |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
@import "~@/assets/styles/index.scss"; |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue