Skip to content

useDrauu

drauu 的反应式实例。

¥Reactive instance for drauu.

示例

Available in the @vueuse/integrations add-on.

安装

¥Install

bash
npm i drauu@^0

用法

¥Usage

vue
<script setup lang="ts">
import { toRefs } from '@vueuse/core'
import { useDrauu } from '@vueuse/integrations/useDrauu'
import { useTemplateRef } from 'vue'

const target = useTemplateRef<SVGSVGElement>('target')
const { undo, redo, canUndo, canRedo, brush } = useDrauu(target)
const { color, size } = toRefs(brush)
</script>

<template>
  <svg ref="target" />
</template>