Leafer
用于创建Leafer组件。
基础用法
App.vue
Import Map
xxxxxxxxxx
35
<script setup lang="ts">
import { LeaferApp } from 'leafer-vue'
import { ref } from 'vue'
const amplitude = 150
let direction = 1
const y = ref(100)
function animate() {
if (y.value > amplitude)
direction = -1
else if (y.value < 50)
direction = 1
y.value += direction
requestAnimationFrame(animate)
}
requestAnimationFrame(animate)
</script>
<template>
<LeaferApp :width="672" :height="340" type="draw">
<Leafer>
<Text
text="Hello Leafer Vue"
fill="#66A659"
font-weight="black"
Show Error
属性
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
width | number | —— | 宽度 |
height | number | —— | 高度 |
pixelRatio | number | 1 | 像素比 |
fill | string | —— | 填充色 |
hittable | boolean | true | 是否响应交互事件 |
更多属性请查看Leafer |🌿 Leafer UI
事件请查看事件处理 |🌿 Leafer Vue