Skip to content

@leafer-editor/worker

在 WebWorker 环境中运行。

基于 @leafer-ui/worker,集成了 图形编辑器文本编辑视图控制滚动条箭头HTML 插件,适用于在线图形编辑的场景。

安装

sh
npm install @leafer-editor/worker
sh
pnpm add @leafer-editor/worker
sh
yarn add @leafer-editor/worker
sh
bun add @leafer-editor/worker

importScripts 引入

通过全局变量 LeaferUI 访问内部功能。

js
importScripts(
  'https://unpkg.com/@leafer-editor/worker@1.0.2/dist/worker.min.js'
)
js
importScripts('https://unpkg.com/@leafer-editor/worker@1.0.2/dist/worker.js')

使用

使用方式、全局变量和 @leafer-ui/worker一致, 只需改下包名,即可运行官网示例代码。

Released under the MIT License.