Skip to content

箭头 插件

为线条添加起始/结束箭头,自带 12 种常用的箭头样式,并支持自定义。

适用平台

支持所有平台。

安装插件

需要安装 arrow 插件才能使用,点此访问 Github 仓库

sh
npm install @leafer-in/arrow
sh
pnpm add @leafer-in/arrow
sh
yarn add @leafer-in/arrow
sh
bun add @leafer-in/arrow

浏览器

通过全局变量 LeaferIN.arrow 访问插件内部功能。

html
<script src="https://unpkg.com/@leafer-in/arrow@1.0.0-rc.22/dist/arrow.min.js"></script>
<script>
  const { Arrow } = LeaferIN.arrow
</script>
html
<script src="https://unpkg.com/@leafer-in/arrow@1.0.0-rc.22/dist/arrow.js"></script>
<script>
  const { Arrow } = LeaferIN.arrow
</script>

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

体验

ts
import { Leafer } from 'leafer-ui'
import { Arrow } from '@leafer-in/arrow'

const leafer = new Leafer({ view: window })

const arrow = new Arrow({  
    y: 50,
    strokeWidth: 5,
    stroke: 'rgb(50,205,121)'
})

leafer.add(arrow)

下一步

Arrow 元素

Released under the MIT License.