vue-book-reader

VueBookReader
10,235 14
Install
npm install vue-book-reader
Latest Version:1.3.5
Vue:3
License:Apache
Last Updated:Oct 20, 2026
Links: GitHub  ·  npm
Maintainer: jinhuan
VueBookReader 标志

VueBookReader

English

npm 版本 npm 每周下载量 许可证

Vue 电子书阅读器

vue-book-reader 基于 foliate-js 封装,可在 Vue 应用中轻松嵌入电子书阅读器。

组件支持 EPUB、MOBI、KF8(AZW3)、FB2、CBZ、TXT 和 PDF(实验性支持,需要 PDF.js)等格式。你也可以通过实现图书接口扩展其他格式。

安装

npm install vue-book-reader

基本用法

<template>
  <div style="height: 100vh">
    <VueReader url="/books/example.epub" />
  </div>
</template>

<script setup>
import { VueReader } from 'vue-book-reader'
</script>

VueReader API

属性

名称 说明 类型 默认值
url 图书的 URL 或本地文件。 string | File 必填
title 阅读器顶部显示的标题;未传入时使用图书元数据中的标题。 string ''
showToc 是否显示目录按钮。 boolean true
getRendition 底层 foliate 视图准备就绪时调用。 (view) => void —
BookView 属性 VueReader 同样支持 BookView 的全部属性。 — —

插槽

名称 说明
title 自定义标题区域的内容。
BookView 插槽 同样支持 BookView 的全部插槽。

暴露的方法

名称 说明 类型
nextPage 翻到下一页。 () => void
prevPage 翻到上一页。 () => void
setLocation 跳转到指定位置。 (href: string) => void

BookView API

属性

名称 说明 类型 默认值
url 图书的 URL 或本地文件。 string | File 必填
location 初始阅读位置,或要更新到的阅读位置。 string | number —
initOption 初始化 foliate 视图时传入的选项。 object —
tocChanged 图书加载完成后调用,参数为目录数组。 (toc: object[]) => void —
getRendition 底层 foliate 视图准备就绪时调用。 (view) => void —

事件

名称 说明 参数
update:location 阅读位置发生变化时触发。 foliate-js 提供的位置变更详情

插槽

名称 说明
loadingView 图书加载期间显示的内容。
errorView 图书加载失败时显示的内容。

暴露的方法

名称 说明 类型
nextPage 翻到下一页。 () => void
prevPage 翻到上一页。 () => void
setLocation 跳转到指定位置。 (href: string) => void

Related Packages

@mundogamernetwork/mgn-flipbook

Interactive flipbook component for Vue 3 with page-flip animations, zoom, sound...

3,193
vue-reader

VueReader

69,162 47
@agilehub/vue-pdf-flipbook

A minimal Vue 3 PDF flipbook with page-flip animation and public APIs for extern...

1,792 0
@libraz/mejiro-vue

Vue components and composables for mejiro — vertical text rendering, EPUB reader...

2,089 1
@amplify-code/book-reader

Headless Vue 3 book reading surface: page-turning spread, zoom, swipe and link h...

605 0

Version History

Version Released Vue License
1.3.5 ^3.5.27 Apache
1.3.4 ^3.5.27 Apache
1.3.3 ^3.5.27 Apache
1.3.2 ^3.5.27 Apache
1.3.1 ^3.5.27 Apache