<movable-area style="border: 1px solid red; width: 100%; height: 30rpx;">
<movable-view :x="x" direction="horizontal" @change="onChange" @touchend="endTouch">text</movable-view>
</movable-area>
<script setup>
import {
ref,
reactive,
computed
} from 'vue';
const x = ref(0);
const onChange = (e) => {
console.log(e);
}
const endTouch = (e) => {
console.log('重置');
x.value = 20;
}
</script>
2 个回复
DCloud_UNI_yuhe
文档中有提到,可以看一下这个:https://uniapp.dcloud.net.cn/tutorial/vue-api.html#componentsolutions
浮世 (作者)
还是不可以