Skip to content

leafer-draw ​

在 Web 环境中运行。

相对 leafer-ui,减少了 App 、查找元素、事件交互等功能,适用于纯绘图场景。

安装 ​

sh
npm install leafer-draw
sh
pnpm add leafer-draw
sh
yarn add leafer-draw
sh
bun add leafer-draw

浏览器引入 ​

html
<script src="https://unpkg.com/leafer-draw@1.0.0/dist/web.min.js"></script>
<script>
  const { Leafer } = LeaferUI
  // ...
</script>
html
<script src="https://unpkg.com/leafer-draw@1.0.0/dist/web.js"></script>
<script>
  const { Leafer } = LeaferUI
  // ...
</script>
html
<script type="module">
  import { Leafer } from 'https://unpkg.com/leafer-draw@1.0.0/dist/web.module.min.js'
  // ...
</script>
html
<script type="module">
  import { Leafer } from 'https://unpkg.com/leafer-draw@1.0.0/dist/web.module.js'
  // ...
</script>

https://unpkg.com 无法访问时,可替换为 https://cdn.jsdelivr.net/npm

使用 ​

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

Released under the MIT License.