Pen
像绘画一样,快速画出不同样式的路径组合。
用法
App.vue
Import Map
xxxxxxxxxx
45
<script setup lang="ts">
import { Pen } from 'leafer-ui'
import { LeaferApp } from 'leafer-vue'
import { ref } from 'vue'
const penRef = ref<Pen>()
function handleDraw() {
penRef.value!.setStyle({
fill: {
type: 'radial',
stops: [
{ offset: 0, color: '#FF4B4B' },
{ offset: 1, color: '#FEB027' },
],
},
})
penRef.value!.roundRect(0, 0, 100, 100, 30)
penRef.value!.setStyle({ y: -5, fill: 'white' })
penRef.value!
.moveTo(40, 30)
.bezierCurveTo(70, 30, 90, 60, 63, 80)
.quadraticCurveTo(50, 88, 40, 80)
.bezierCurveTo(10, 60, 50, 40, 40, 30)
}
Show Error
详情查看Path |🌿 Leafer UI。
事件请查看事件处理 |🌿 Leafer Vue