diff --git a/src/views/bookRackList.vue b/src/views/bookRackList.vue index cfad01d..7cee300 100644 --- a/src/views/bookRackList.vue +++ b/src/views/bookRackList.vue @@ -62,7 +62,6 @@ export default { initSwiper() { this.$nextTick(() => { for (const key in this.bookList) { - console.log(key) this.bookList[key].forEach((el, index) => { new Swiper('.swiper' + index, { slidesPerView: 'auto', @@ -114,6 +113,14 @@ export default { params.shelfNo = this.$route.query.rightShelfNo } initBookshelfDetails(params).then((res) => { + console.log(this.listData) + if (res.shelfs.length === 0) { + res.shelfs.push('firstShelf', 'secondShelf', 'thirdShelf', 'fourthShelf', 'fivethShelf') + for (let index = 0; index < res.shelfs.length; index++) { + const shelfNo = res.shelfs[index] + res.shelfBook[shelfNo] = [] + } + } this.listData.splice(0, this.listData.length, ...res.shelfs) for (let index = 0; index < res.shelfs.length; index++) { const shelfNo = res.shelfs[index]