Skip to content

Commit

Permalink
add slot for book content
Browse files Browse the repository at this point in the history
  • Loading branch information
Jussiadev committed Apr 3, 2018
1 parent ac557ae commit 2bebe03
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/book-reader/BookReader.vue
Expand Up @@ -4,7 +4,9 @@
<slot name="prev-btn" :goToPrevPage="goToPrevPage">
<div id="prev" class="arrow" @click="goToPrevPage">‹</div>
</slot>
<div ref="viewer" id="area"></div>
<slot name="book-content">
<div id="area"></div>
</slot>
<slot name="next-btn" :goToNextPage="goToNextPage">
<div id="next" class="arrow" @click="goToNextPage">›</div>
</slot>
Expand Down Expand Up @@ -52,6 +54,10 @@ export default {
progress: {
type: Number,
required: true
},
bookArea: {
type: String,
default: 'area'
}
},
data () {
Expand Down Expand Up @@ -81,7 +87,7 @@ export default {
},
methods: {
initReader () {
this.rendition = this.book.renderTo(this.$refs.viewer, {
this.rendition = this.book.renderTo(this.bookArea, {
contained: true
})
this.registerThemes()
Expand Down
45 changes: 45 additions & 0 deletions static/left-alignment.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions static/search.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2bebe03

Please sign in to comment.