Skip to content

Commit

Permalink
fix: add loading on book detail
Browse files Browse the repository at this point in the history
  • Loading branch information
bayang committed Apr 7, 2022
1 parent 571024e commit e580d25
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/jelu-ui/src/components/BookDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ const book: Ref<UserBook | null> = ref(null)
const edit: Ref<boolean> = ref(false)
const showModal: Ref<boolean> = ref(false)
const getBookIsLoading: Ref<boolean> = ref(false)
const getBook = async () => {
try {
getBookIsLoading.value = true
book.value = await dataService.getUserBookById(props.bookId)
getBookIsLoading.value = false
useTitle('Jelu | ' + book.value.book.title)
} catch (error) {
console.log("failed get book : " + error);
getBookIsLoading.value = false
}
};
Expand Down Expand Up @@ -506,6 +511,11 @@ getBook()
</div>
</div>
</div>
<o-loading
v-model:active="getBookIsLoading"
:full-page="true"
:can-cancel="true"
/>
</template>

<style lang="scss" scoped>
Expand Down

0 comments on commit e580d25

Please sign in to comment.