Skip to content

t-movable-area

MovableArea 可移动区域

组件介绍

t-movable-area 是可移动区域组件,用于承载 t-movable-view 组件。通过在视图层内部处理拖动,避免逻辑层和视图层之间的通信损耗,实现流畅的拖动体验。

平台兼容

HarmonyH5AndroidiOS小程序UTS

基础用法

基础用法参考 demo/movable/movable.uvue,配合 t-movable-view 使用。

vue
<template>
  <t-movable-area class="w-100% h-400 bg-#f5f5f5">
    <t-movable-view 
      direction="all" 
      :inertia="true" 
      :x="x" 
      :y="y">
      <view class="w-100 h-100 bg-primary"></view>
    </t-movable-view>
  </t-movable-area>
</template>

<script setup>
const x = ref(0)
const y = ref(0)
</script>

Props

属性名说明类型默认值
scaleArea是否支持双指缩放区域booleantrue
path点击组件后跳转的页面路径string''
hover是否启用点击效果booleanfalse
type组件主题类型string''
disabled是否禁用booleanfalse
effect组件显示主题string''
size组件尺寸string''

Slots

插槽名说明
default默认插槽,放置 t-movable-view 子组件