@leafer-draw/worker
Compared to @leafer-ui/worker, this package reduces features such as App and event interactions, making it suitable for pure drawing scenarios.
web version worker version node version mini program version
Runs in a Web Worker multithreaded background environment and cannot operate the DOM.
The web version and worker version can coexist in the same project and be used together as needed.
Installation
sh
npm install @leafer-draw/workersh
pnpm add @leafer-draw/workersh
yarn add @leafer-draw/workersh
bun add @leafer-draw/workerOr import via importScripts
Access internal features through the global variable LeaferUI.
js
importScripts('https://unpkg.com/@leafer-draw/worker@2.1.0/dist/worker.min.js')js
importScripts('https://unpkg.com/@leafer-draw/worker@2.1.0/dist/worker.js')Update
Learn how to quickly update versions.
Usage
The usage, global variables, and @leafer-ui/worker are consistent. You only need to change the package name to run the official example code.