Introduction
a vue wrapper for foliate-js - library for rendering e-books in the browser
Installation
sh
npm install vue-book-reader --savesh
pnpm add vue-book-reader --saveBasic Usage
And in your vue-component...
Different Builds
| Module | Filename |
|---|---|
| UMD(for browsers) | vue-book-reader.umd.js |
| ES Module(for bundlers) | vue-book-reader.es.js |
VueReader API
VueReader Attributes
| Name | Description | Type | Default |
|---|---|---|---|
| url | book url or File | string/File | — |
| location | set / update location of the book | string/number | — |
| title | the title of the book | string | — |
| showToc | whether to show the toc | boolean | true |
| BookView Attributes | BookView attributes all can be used. | - |
VueReader Slots
| Name | Description |
|---|---|
| title | book title |
| BookView slots | BookView slots all can be used. |
VueReader Exposes
| Name | Description |
|---|---|
| BookView Exposes | BookView exposes all can be used. |
BookView API
BookView Attributes
| Name | Description | Type | Default |
|---|---|---|---|
| url | book url or File | string/File | |
| tocChanged | get an array representing the table of contents of the book | function(href) |
BookView Slots
| Name | Description |
|---|---|
| loadingView | BookView loadingView |
| errorView | BookView errorView |
BookView Exposes
| Name | Description | Type |
|---|---|---|
| nextPage | display next page | function |
| prevPage | display previous page | function |
| setLocation | Set the page | function(href) |