0.1.1 • Published 12 months ago

epub-element v0.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

epub-element

a JS library base Web Component for rendering ePub documents in the browser

使用WebComponent实现的epub解析渲染

epub组成

epub展示

Feature💪

  • 通过webcomponent实现而不是iframe
  • 渲染布局支持连续滚动或者分页模式
  • 支持虚拟列表动态渲染
  • 插件系统,支持主题色、搜索高亮等

Quick Start

import { EpubElement } from 'epub-element';

EpubElement.openEpub('history.epub').then((epubEl) => {
    // 挂载
    ins.mount(document.getElementById('epub'));
})

Options

openEpub(url: string)

optiondescriptiontypedefault
urlepub文件路径,目前内部是通过fetch去请求的string-

mount

mount(el: HTMLElement, options: EpubElementMountOptions)

EpubElementMountOptionsdescriptiontypedefault
layout布局scrollpaginatedscroll
virtual是否启用虚拟列表,否则全文加载渲染booleantrue
spread双栏模式(只在paginated下有效)booleanfalse
pluginsepub文件路径,目前内部是通过fetch去请求的array[]

Documnets

敬请期待...

Running Locally

pnpm i
pnpm run demo:vue  # 在vue3上使用的例子
0.1.1

12 months ago

0.1.0

12 months ago