vue-booklet
Vue book-like compoment for create a your own e-book
Vue Booklet is a compoment which can let your create a flipable book fastly, and is responsive. As it's used css animation, it will not support IE 9 and other old browser.
Installation
or
Usage
Import module from vue-booklet, then register it to Vue:
And import the css file in your html file:
After that, you can use vue-booklet on your project now.
Without webpack
Example
Methods
prevPage(), nextPage()
Function for control the book without button.
movePage(pageNum)
Function for allow user move to specify page.
Props
displayPageNumber(optional)
Default value is true. Will not show page number when it is false.
enableControl(optional)
Default value is true. Will not allow user control the book when it is false.
If you want to control it, add ref to book compoment and call function like this:
displayButton(optional)
Default value is true. Will not show nextPage and PrevPage button when it is false.
Only work when the value of allowFlip is true.
enableSelectPage(optional)
Default value is true. Will not allow user select page when it is false.
Only work when the value of allowFlip is true.
langcode(optional)
Set the language of booklet UI.
Current support language is English (en), Traditional Chinese (zh-hant) and Simplified Chinese (zh-hans). You can add new langcode with translation props.
Default value is en.
translation(optional)
Define translation of booklet UI. You can pass object or JSON string with translated text to it.
Default value:
pageTransitionTime (optional)
Set the transition time of each book page.
Default value is 0.8s.
onOpened(book, position) (optional)
A callback which happens after book opened. Pass the book dom which you can control it, and position of book.
onClosed(book, position) (optional)
A callback which happens after book closed. Pass the book dom which you can control it, and position of book.
onFlipStart(currentPage, direction) (optional)
A callback which happens before a page filped. Pass the page dom which you can control it,
and direction for you to know filped to next page or previous page.
onFlipEnd(currentPage, direction) (optional)
A callback which happens after a page filped. Pass the page dom which you can control it,
and direction for you to know filped to next page or previous page.