Skip to content

Vue2

因为vue2不支持自定义渲染器,所以采用封装组件的方式,实现leafer-ui组件化

快速安装

bash
pnpm i leafer-vue@2
bash
yarn add leafer-vue@2
bash
npm i leafer-vue@2
bash
bun add leafer-vue@2
vue
<script setup lang="ts">
import { lfFrame, lfLeafer, lfRect } from 'leafer-vue'
</script>

<template>
  <lfLeafer :width="500" :height="500" fill="#000">
    <lfFrame :width="300" :height="300" fill="#0f0">
      <lfRect
        :width="100" :height="100" fill="#f00"
        :draggable="true"
        @tap="console.log('tag')"
      />
    </lfFrame>
  </lfLeafer>
</template>

Released under the MIT License.